Multiline Evaluation Expression

General questions about using TextPad

Moderators: AmigoJack, bbadmin, helios, MudGuard

Post Reply
bengma
Posts: 1
Joined: Wed May 28, 2008 5:24 pm

Multiline Evaluation Expression

Post by bengma »

I'm trying to write an expression to do subsitution that will match against a multiline string.

Code: Select all

<x:tag attribute1="1"
  attribute2="2"
  attribute3="3"/>
I want to modify this multiline value by removing the tag termnination characters '/>' and appending '>&nbsp;</x:tag>". I'm not concerned if the value remains multiline or not.

Code: Select all

<x:tag attribute1="1"
  attribute2="2"
  attribute3="3">&nbsp;</x:tag>
My real issue is figuring out how to evaluate across newline or end-of-line values. I would like to do this as search and replace in Textpad.
User avatar
Bob Hansen
Posts: 1516
Joined: Sun Mar 02, 2003 8:15 pm
Location: Salem, NH
Contact:

Post by Bob Hansen »

Not sure why you need to go across multiple lines. Will this work?

Search for: />
Replace with: >\&nbsp;</x:tag>

Use the following settings:
-----------------------------------------
[X] Regular expression
Replace All
-----------------------------------------
Configure | Preferences | Editor
[X] Use POSIX regular expression syntax
-----------------------------------------
Hope this was helpful.............good luck,
Bob
Post Reply