Page 1 of 1

Multiline Evaluation Expression

Posted: Wed May 28, 2008 5:31 pm
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.

Posted: Thu May 29, 2008 4:04 am
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
-----------------------------------------