[CLUE-Talk] Multiline Regex

Timothy Klein teece at silverklein.net
Fri Jul 2 13:31:52 MDT 2004


On Friday 02 July 2004 12:35 pm, William wrote:
> Not sure what your regexp background is, but I'll toss a couple hints out
> (based on some common mistakes):
>
> $  matches the end of a line
> .  matches any character EXCEPT the end-of-line
>

Interestingly, $ would not work on the multiline regex that I did get to work.  
I had to to s/\n\n^\([alnum])/^M\\paragraph*{\1}/.  Or something like that.  
That is not it exactly (there are other characters in the [ ] because this is 
old English, so there are Latex markups for thorn, eth, ash, and letters with 
macron's over them.  But the same trick seems to fail for this case (probably 
because \n is embedded in a [ ]).

But, I bit the bullet and read up on sed.  The example I found did the trick, 
with a tweak, and sed isn't that hard at all.  The limited bit I have learned 
so far makes it seem like a command line regex search and replace.  Thus it 
was pretty damn easy to learn enough to do what I needed.

Tim
-- 
== Timothy Klein || teece at silverklein.net
== Vanity Page: http://tinyurl.com/vkhp
== ----------------------------------------
== Hello_World.c: 17 Errors, 31 Warnings...



More information about the clue-talk mailing list