Line feeds inside a class expression

General questions about using TextPad

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

Post Reply
notreadbyhumans
Posts: 1
Joined: Fri Jan 15, 2010 11:51 am

Line feeds inside a class expression

Post 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.
User avatar
Bob Hansen
Posts: 1517
Joined: Sun Mar 02, 2003 8:15 pm
Location: Salem, NH
Contact:

Post 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.
Hope this was helpful.............good luck,
Bob
Post Reply