You say:
The aim is to replace these with my
own custom wrapped acronym tags in a
ColdFusion application I'm writing.
It sounds like using XSL might be more appropriate than regex to transform one tag into another.
UPDATE:
Just threw this together, it seems to work for simple cases:
(NOTE: this will simply strip out the 'acronym' tags. You could use XSL to replace them with your own custom tags, but you didn't specify anything along those lines so I didn't get into that)
XSL:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="*[name() = 'acronym']" />
</xsl:stylesheet>
Input:
<?xml version="1.0" encoding="UTF-8"?>
<root>
This is some test text about <acronym
title="Incomplete Test Syndrome"
class="CustomClass">ITS</acronym> for
the **ITS** department. Also worth
mentioning ABS as well I guess.ITS,
This is some **ITS** test text about
<acronym title="Incomplete Test
Syndrome"
class="GOTManager">ITS</acronym> for
the ITS department. Also worth
mentioning ABS as well I guess
</root>
Output:
<?xml version="1.0" encoding="UTF-8"?>
This is some test text about for
the **ITS** department. Also worth
mentioning ABS as well I guess.ITS,
This is some **ITS** test text about
for
the ITS department. Also worth
mentioning ABS as well I guess
UPDATE:
You said:
So in the first example I want it to
ignore the wrapped ITS and give me the
ITS at the end of the 1st sentence.
In the second example I want it to
return the ITS at the start of the 2nd
sentence.
This makes no sense. Your second example doesn't have "ITS" in the second sentence. I think what you meant was that the **ITS**
is what you want to have extracted.
The XSL sample I gave only strips the <acronym/>
tags, but after that's done you can try to find the ITS
at different points in the sentence and maybe for that a regex might be easy (this assumes that you're ONLY have to worry about the <acronym/>
tags).