Java Mailing List Archive

http://www.ant-tasks.com/

Apache Ant Archive

» Ant Users List
» Ant Developers List
Problem with regular expression and Ant 1.5.1

Problem with regular expression and Ant 1.5.1

2003-03-18       - By Albert Sidelnik

I've been stumped for a few days with a particular search/replace
expression that I'm using under Ant 1.5.1 which is
using Jakarta Oro for it's regex engine. Here are the details to my
problem:

The keyword that I'm searching for and trying to replace is the keyword
"class". I'm trying to replace it with the word "trainingClass"
as in the following example:

<civ:validateForm name="HomePageForm"
   method="post"
   action="utilities/Homepage/homepage"
   class="org.civ.architecture.validation.FormValidation"
   schema="/WEB-INF/Constraints.xsd"
   pageMbde="<%=PageMbde.EDIT%>">

the version I'd like to have would be the following:
<civ:validateForm name="HomePageForm"
   method="post"
   action="utilities/Homepage/homepage"
   trainingClass="org.civ.architecture.validation.FormValidation"
   schema="/WEB-INF/Constraints.xsd"
   pageMbde="<%=PageMbde.EDIT%>">

Here is the expression that I'm using:
(<civ[.|\s]*)class

Here is the exact ant syntax that I'm using:
<replaceregexp
   match="(&lt;civ[.|\s]*)class"
   replace="\1trainingClass"
   flags="mg"
   byLine="false">
   <fileset dir=...../>

Now to add more of a twist to this..there are more than one occurances
to the tags mentioned above that appear in my jsp's. So
they all would need to be evaluated for that particular expression.
Can somebody help me out. This is killing me. Thanks
-Albert


©2008 ant-tasks.com - Jax Systems, LLC, U.S.A.