in reply to Re^3: Regex Problem - alternative searched
in thread Regex Problem - alternative searched

THANKS! A slight modification seems to work: (?s)<!--(.(?<!--))*-->

At first it appears a bit odd because of the negative lookbehind which looks like an XML Comment start ;-)


s$$([},&%#}/&/]+}%&{})*;#$&&s&&$^X.($'^"%]=\&(|?*{%
+.+=%;.#_}\&"^"-+%*).}%:##%}={~=~:.")&e&&s""`$''`"e

Replies are listed 'Best First'.
Re^5: Regex Problem - alternative searched
by BrowserUk (Patriarch) on May 18, 2007 at 14:57 UTC

      I'm astonished you don't know (?s). It's the same as .../s just inside the regex. It makes the . match lineends too in telling the regex to treat the text as a (?s)-ingle line instead of (?m)-ultiple lines.

      search for "imsx-imsx" in perldoc perlre


      s$$([},&%#}/&/]+}%&{})*;#$&&s&&$^X.($'^"%]=\&(|?*{%
      +.+=%;.#_}\&"^"-+%*).}%:##%}={~=~:.")&e&&s""`$''`"e