in reply to Regex help
I see a few potential problems here.
- The regex you show won't work, because you didn't escape your / in </script>
- the dot (.) doesn't match _anything_, by default it doesn't match newlines. The /s modifier at the end of the regex changes that behavior to what you want. (see perlre)
Update: Paren typo corrected per fglock below. (Was (.*)?, which would be a greedy match, with the ? essentially pointless, acting on a * modified group) I left the parens in to show a capture, but fglock is completely correct that you don't need the parens.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Re: Regex help
by fglock (Vicar) on Oct 01, 2002 at 20:34 UTC | |
by Anonymous Monk on Oct 01, 2002 at 23:40 UTC |
In Section
Seekers of Perl Wisdom