Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ant regex <mapper> task

Status
Not open for further replies.

snenkov

Programmer
Jun 4, 2007
1
0
0
US
Hi,

how do I replace a substring from a path?

I am using

<pathconvert property="to.classpath" refid="from.classpath" >
<mapper>
<mapper type="regexp" from="(.*)bin(.*)" to="\1\2"/>
</mapper>
</pathconvert>

where

from.classpath is

"C:\temp\dp\util\bin;C:\temp\dp\util\stack"

\1

returns

C:\temp\dp\util\

but

\2

does not return anything.

I would like to get back

"C:\temp\dp\util\;C:\temp\dp\util\stack"


Thanks
Stefan
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top