Modifing config files

Tyler Bird BIRDTY at uvsc.edu
Fri Feb 25 09:37:30 MST 2005


Heres a multi-line regex from tom christiansen on FMTEYEWTK 

http://www.perl.com/doc/FMTEYEWTK/regexps.html

    while ( 
       m{                       # m{foo} is like /foo/, but helps vi's
% key

                 \b             # first find a word boundary

                 (\w+)          # followed by the biggest word we can
find
                                # which we'll save in the \1 buffer
                 (              
                   \s+          # now have some white space following
it
                   \1           # and the word itself
                 )+             # repeat the space+word combo ad
libitum

                 \b             # make sure there's a boundary at the
end too

        }xgi                    # /x for space/comment-expanded
patterns
                                # /g for global matching
                                # /i for case-insensitive matching
    )

Tyler Bird
UVSC - Continuing Education



>>> nick at byu.edu 02/25/05 9:05 AM >>>
On Friday 25 February 2005 09:00 am, jeff wrote:
> Oops, I missed something.  I need to be able to specify the section.
> i.e. [import]

No, you didn't miss anything--I did.  The code I posted doesn't do
that.  
You'll have to figure out how to do a multi-line regex--I know it's
possible, 
just not how to do so offhand.

Perl gurus?

-- 
Respectfully,

Nicholas Leippe
Sales Team Automation, LLC
1335 West 1650 North, Suite C
Springville, UT  84663 +1 801.853.4090
http://www.salesteamautomation.com 
.===================================.
| This has been a P.L.U.G. mailing. |
|      Don't Fear the Penguin.      |
|  IRC: #utah at irc.freenode.net   |
`==================================='



More information about the PLUG mailing list