in reply to Re: Search and replace over line break
in thread Search and replace over line break

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.
  • Comment on Re^2: Search and replace over line break

Replies are listed 'Best First'.
Re^3: Search and replace over line break
by Svante (Sexton) on Mar 14, 2010 at 01:29 UTC

    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.