in reply to Re: Re: Regex: find/Replace words between tags (non greedy re )
in thread Regex: find/Replace words between tags
The problem enters when wirey is replaced in the TEXT field. The code seems to gravitate towards testing the last instance of ENDTITLE rather that the 1st. Is this a nesting Issue? I was thinking that nesting is like this .BEGTITLE title BEGTITLE title2 ENDTITLE ENDTITLE, where there is not a balanced symmetry like you might find in a comma delimited file. In my case there is always a ENDTITLE before the appearence of the 2nd+ instance of a BEGTITLE tag. Thanks. I am just trying to learn as much of this as I can. I thought the (.*?) usage would keep the script from being greedy like this.sample in.txt blah...blah...blah BEGTITLE My dog is stinkey ENDTITLE BEGTEXT My dog has wirey hair ENDTEXT BEGTITLE My dog's name is skip ENDTITLE blah...blah...blah
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: Re: Regex: find/Replace words between tags (non greedy re )
by Anonymous Monk on Dec 16, 2001 at 02:42 UTC |