RE, tags, and the newline

General questions about using TextPad

Moderators: AmigoJack, bbadmin, helios, Bob Hansen, MudGuard

Post Reply
David

RE, tags, and the newline

Post by David »

Basically, I want to find all pairs of lines which start with the same letter. So I tried
^\([[:alpha:]]\).*\n\1
but it tells me it's an invalid regular expression, which I'm pretty sure is due to the \n (I remove it and it works, even if it doesn't return what I want)
Anyone know why this would be, or how I can make it work?
Andreas

Re: RE, tags, and the newline

Post by Andreas »

replace \n with a character or character combination not existing in your text, e.g. @@@. Also add @@@ at the beginning of the line.

then use
@@@\([[:alpha:]]\).*\@@@\1
instead.

When finished, remove first @@@, then replace @@@ by \n
Post Reply