Find and replace over several lines

General questions about using TextPad

Moderators: AmigoJack, bbadmin, helios, MudGuard

Post Reply
ferdi77
Posts: 2
Joined: Thu Jan 24, 2008 2:49 pm

Find and replace over several lines

Post by ferdi77 »

I have a question concerning the find and replace function in textpad. I do not know how to find and replace an expression over several lines. For example I want to find everthing between the lines
\begin{}
here some text
\end{}
I know how I could do the search I the number between \begin and \end is fixed, but not if I do not know the certain number of lines. Is there a repitition character for \n?
Thank you very much for the help.
bye,
ferdi
User avatar
Bob Hansen
Posts: 1516
Joined: Sun Mar 02, 2003 8:15 pm
Location: Salem, NH
Contact:

Post by Bob Hansen »

You could first do a Search/Replace for \n and replace with a unique character like "~".

Then do your RegEx for \begin ... \end.

Then replace "~" with "\n"
Hope this was helpful.............good luck,
Bob
ferdi77
Posts: 2
Joined: Thu Jan 24, 2008 2:49 pm

Post by ferdi77 »

Yes, thank you that works. Is there a restriction how long a line can be?
thanks,
ferdi
Post Reply