ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jakob" <>
Subject regexp contains "<" and ">" ...
Date Tue, 23 Mar 2004 16:02:24 GMT

I am using Ant 1.6.0, and I would like to use Ant's
regular expression task <replaceregexp/> to modify an XML
file.  I know that this is not the ideal way to do this,
but this is a mixed-content issue for which XSLT is not
really appropriate.  Apparently, the problem is that the
reserved character "<" is used inside an attribute value

I would like to change this regexp


with this:


I have tried these:

<replaceregexp flags="g" byline="false">
  <regexp pattern="([^\s]+)<SUB>([^<]+)</SUB>"/>
  <fileset dir="test"><includes="test.xml"/></fileset>

E:\test\build.xml:167: The value of attribute "pattern"
associated with an element type "regexp" must not contain
the '<' character.

<replaceregexp flags="g" byline="false">
  <fileset dir="test"><include name="test.xml"/></fileset>

E:\test\build.xml:173: The <regexp> type doesn't support
nested text data.

Is there a way to do this in Ant, or should/must I call an
external task?

Thanks in advance,

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message