You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Ja...@rzf.fin-nrw.de on 2007/08/01 08:56:39 UTC
AW: multiple regexs against a single doc
Maybe something like
<move>
<filterchain>
<tokenfilter>
<filetokenizer/>
<replaceregex pattern="" replace="" flags="s"/>
<replaceregex pattern="" replace="" flags="s"/>
Jan
>-----Ursprüngliche Nachricht-----
>Von: Mario Madunic [mailto:hajduk@imag.net]
>Gesendet: Dienstag, 31. Juli 2007 16:00
>An: Ant Users List
>Betreff: multiple regexs against a single doc
>
>Right now I'm doing the following with each regex that I
>require to replace some
>string or char
>
>
><replaceregexp match="(\ue06d)" replace="\&#x00b5;"
>flags="g" byline="true"
>encoding="utf-8">
><fileset dir="${l_Drive}\${randDirName}\drop" includes="*.xml" />
></replaceregexp>
>
><replaceregexp match="(\u2009)" replace=" " flags="g" byline="true"
>encoding="utf-8">
><fileset dir="${l_Drive}\${randDirName}\drop" includes="*.xml" />
></replaceregexp>
>
>etc...(x100)
>
>This is a slow process as each file is "opened" and "closed"
>for each regex.
>What I'd like to do is open a file and parse with multiple
>regexs before going
>to the next regex. Is this possible? I have over a hundred regexs.
>
>Thanks
>
>Marijan Madunic
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
>For additional commands, e-mail: user-help@ant.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org
Re: AW: multiple regexs against a single doc
Posted by Mario Madunic <ha...@imag.net>.
Thanks Jan,
works basically but am having problems with certain regexs
<replaceregex pattern="(\s+)" replace=" " flags="g" byline="true" />
does nothing
<replaceregex pattern="(_TAB_)" replace="see note below" flags="g" byline="true" />
been trying to place a regex inside the @replace but with no luck. I'm trying to
replace the _TAB_ string with an actual tab so one of the following should do
something: \t, \u0011, \ (might have the u and x backwards).
Any help with this will be appreciated.
Thanks
Mario Maddunic
Quoting Jan.Materne@rzf.fin-nrw.de:
> Maybe something like
>
> <move>
> <filterchain>
> <tokenfilter>
> <filetokenizer/>
> <replaceregex pattern="" replace="" flags="s"/>
> <replaceregex pattern="" replace="" flags="s"/>
>
>
> Jan
>
>
>
> >-----Ursprüngliche Nachricht-----
> >Von: Mario Madunic [mailto:hajduk@imag.net]
> >Gesendet: Dienstag, 31. Juli 2007 16:00
> >An: Ant Users List
> >Betreff: multiple regexs against a single doc
> >
> >Right now I'm doing the following with each regex that I
> >require to replace some
> >string or char
> >
> >
> ><replaceregexp match="(\ue06d)" replace="\&#x00b5;"
> >flags="g" byline="true"
> >encoding="utf-8">
> ><fileset dir="${l_Drive}\${randDirName}\drop" includes="*.xml" />
> ></replaceregexp>
> >
> ><replaceregexp match="(\u2009)" replace=" " flags="g" byline="true"
> >encoding="utf-8">
> ><fileset dir="${l_Drive}\${randDirName}\drop" includes="*.xml" />
> ></replaceregexp>
> >
> >etc...(x100)
> >
> >This is a slow process as each file is "opened" and "closed"
> >for each regex.
> >What I'd like to do is open a file and parse with multiple
> >regexs before going
> >to the next regex. Is this possible? I have over a hundred regexs.
> >
> >Thanks
> >
> >Marijan Madunic
> >
> >---------------------------------------------------------------------
> >To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> >For additional commands, e-mail: user-help@ant.apache.org
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org