I'm trying to add copyright information to the top of XML files. However, it needs to go after the prologue:
<?xml version="1.0"?>
..>
My problem is that some XML Documents have the ..> tag spread out over many lines and I need to add the copyright information after the whole tag. With the following regular expression, it only matches the first line of the ..> tag. Any help would be appriciated. Thanks.
http://www1.cs.columbia.edu/~lennox/perlre.html is a great site to learn about regex's.... look up the "multi-line" regular expression test with the match operator. You'll be amazed at the power and versatility of it.
Thanks for the reply. I had tried adding /m to the end of the substitution, but that didn't work. Then it matches the <?XML...> tag, but not the ..>. It inserts the copyright info inbetween the <?XML...> and ..> tags, like it didn't recognize the ..> tag. I also tried adding /s to the end, and that matched the entire document, which really screwed things up. The beginning of the XML file I'm testing looks like this...
[HTML] [/HTML]
but there are a few other files that have many lines of ..>.