in reply to Re: Re: strip out lines until match
in thread strip out lines until match
If you turned "use strict" on, you'd see the problem.
string = " blah @QUERY meaningful data meaningful data ... etc... @ENDQUERY @QUERY2 more data more data ... etc ... @ENDQUERY2"; Possible unintended interpolation of @QUERY in string at (eval 1) line + 1, <> line 16. Possible unintended interpolation of @ENDQUERY in string at (eval 1) l +ine 1, <> line 16. Possible unintended interpolation of @QUERY2 in string at (eval 1) lin +e 1, <> line 16. Possible unintended interpolation of @ENDQUERY2 in string at (eval 1) +line 1, <> line 16.
Replace the "s with 's when you initialise $string and you will see the correct result.
Also, as Enlil points out elsewhere in the thread, my regex was more complex than necessary. It can be replaced with s[\s+(\n\@QUERY)][$1]g;.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: Re: strip out lines until match
by alienhuman (Pilgrim) on Apr 16, 2004 at 15:17 UTC |