Page 1 of 1

Line feeds inside a class expression

Posted: Fri Jan 15, 2010 11:58 am
by notreadbyhumans
I have the following which I want to use a regular expression to replace:

Code: Select all

Some known text

some unknown text that includes an unknown number of line feeds (\n)

Some more known text
The problem I am having is with the unknown number and location of line feeds. I have tried various iterations of the below but cannot get it to deal with the line feeds:

Code: Select all

Some known text[[:print:][:space:][:cntrl:]]*Some more known text
Is there a way of including line feeds within the class expression as that seems to be the thing that is causing the problem?

Thanks.

Posted: Fri Jan 15, 2010 12:35 pm
by Bob Hansen
TestPad RegEx does not handle unknown number of multiple \n codes. But there are two work arounds that seem to work.

1. Use WildEdit, which does handle the multiple lines.

2. Using TextPad:
First replace all }\n" with an unused character like the tilde (~).
Then, do your Search/Replace scanning the multiple "~".
Finally replace the "~" with "\n".

You may be able to make a macro to do the TextPad work steps above.