You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Albert Sidelnik <Si...@C-IV.org> on 2003/03/19 01:18:32 UTC

Problem with regular expression and Ant 1.5.1

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