Can't get tagged expressions to work

General questions about using TextPad

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

Post Reply
mrbroschat
Posts: 3
Joined: Fri Sep 19, 2003 7:47 pm

Can't get tagged expressions to work

Post by mrbroschat »

I successfully use this code to find what I want:

member: \n[[:print:]]*\n

Because I want to delete the trailing newline, I would like to replace with most of that (using Posix):

(member: \n[[:print:]]*)\n

This always generates an "Unmatched '(" error.

I appreciate anyone pointing out what I'm doing wrong...

Michael
User avatar
Bob Hansen
Posts: 1516
Joined: Sun Mar 02, 2003 8:15 pm
Location: Salem, NH
Contact:

Post by Bob Hansen »

You are searching for: member: \n[[:print:]]*\n

and Replacing with: (member: \n[[:print:]]*)\n ?

I think you want to Search for: (member: )\n([[:print:]]*)\n
and
Replace with: \1\2

if you are just trying to replace the \n codes.

Note: the Search/Relace I provided are untested.
Hope this was helpful.............good luck,
Bob
mrbroschat
Posts: 3
Joined: Fri Sep 19, 2003 7:47 pm

That's it!

Post by mrbroschat »

Actually, I was just trying to join two lines, by deleting the second newline (which picks up a third line, conjoining it to the second line).

Your successful code appears to suggest that \n cannot appear within a tagged expression?

Anyway, it works wonderfully.

I used this for a search:

Code: Select all

(member: )\n([[:print:]]*)\n
[/b]

and this for a replace:

Code: Select all

\1\n\2
[/b]

So, this:

Code: Select all

member: 
 CN=Feinberg\, Michael,OU=_Users,OU=xxx,OU=xxx,OU=xxx,OU=xxx,OU=xxz
 zxxx,DC=xxx,DC=xxx,DC=xxx,DC=xxx
becomes:

Code: Select all

member: 
 CN=Feinberg\, Michael,OU=_Users,OU=xxx,OU=xxx,OU=xxx,OU=xxx,OU=xxxxx,DC=xxx,DC=xxx,DC=xxx,DC=xxx


TextPad forever...

Michael[/code]
Post Reply