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?
RE, tags, and the newline
Moderators: AmigoJack, bbadmin, helios, Bob Hansen, MudGuard
-
Andreas
Re: RE, tags, and the newline
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
then use
@@@\([[:alpha:]]\).*\@@@\1
instead.
When finished, remove first @@@, then replace @@@ by \n