in reply to Search and replace over line break

If there is a newline in your search string, where do you want that newline to appear in your replacement string?

By the way, seeing as you put <> around your strings: *stern look* you are not trying to parse XML or HTML with regular expressions, are you?

Replies are listed 'Best First'.
Re^2: Search and replace over line break
by Anonymous Monk on Mar 13, 2010 at 18:48 UTC
    I am trying to parse XML with regular expressions - not a good idea ? It's DITA actually - but that's XML also. Tell me if this is a bad idea - the issue I'm working on is fixing up some XML files that have a whole list of "bad" tags - mostly removing them, but sometime having to replace them with something else.

      XML is not a regular language (please note that "regular" has a specific meaning with regard to a language; look it up if you do not know what this means). Therefore, you cannot generally parse it with a regular expression.

      Take an XML library that fits your need. Here are some descriptions of such.