Java Mailing List Archive

Apache Ant Archive

» Ant Users List
» Ant Developers List
regex text out of a file

regex text out of a file

2007-07-20       - By Dominique Devienne
Reply:     1     2     3     4     5     6     7     8     9  

On 7/20/07, Alex Egg <eggie5@(protected)> wrote:
> All I want to do is get the value of the 'src' attribute, how would a
> replaceregex help me?

I'm sorry, but I don't have the time to give you the solution, only
guide you as best I can...

<replaceregex pattern="(\d+) @{pattern}.*" replace="\1" />

The pattern *captures* only the part of the line of interest (using
the parens), and replace the whole line with that capture, in the
replace attribute, with \1, i.e. the first capture. --DD

To unsubscribe, e-mail: user-unsubscribe@(protected)
For additional commands, e-mail: user-help@(protected)

©2008 - Jax Systems, LLC, U.S.A.