Hi Gilbert,

thank you for the example. It works for me as well. I will use propertyregex
in that case

Stefan


Rebhan, Gilbert wrote:
> 
>  
> Hi,
> 
> 
> -----Original Message-----
> From: snenkov [mailto:[EMAIL PROTECTED] 
> Sent: Wednesday, June 13, 2007 12:01 AM
> To: [email protected]
> Subject: ant regex
> 
> /*
> I want to get back
> 
> "C:\temp\dp\util\;C:\temp\dp\util\stack"
> */
> 
> your regexp works for me with antcontrib <propertyregex>,
> using the default regexp engine from sun jdk1.4
> 
> <project name="bla" default="main" basedir=".">
>     <!-- Import AntContrib -->
>     <taskdef resource="net/sf/antcontrib/antlib.xml" />
> 
>     <property name="teststring"
> value="C:\temp\dp\util\bin;C:\temp\dp\util\stack"/>
> 
>     <target name="depends">
> 
>       <propertyregex property="newstring"
>                     input="${teststring}"
>                     regexp="(.*)bin(.*)"
>                     replace="\1\2"
>                     casesensitive="false" />
>     </target>
> 
>     <target name="main" depends="depends">
>       <echo>$${newstring} == ${newstring}</echo>
>     </target>
> 
> </project>
> 
> 
> [echo] ${newstring} == C:\temp\dp\util\;C:\temp\dp\util\stack
> 
> 
> when using
>  replace="\2"
> 
> i get =
> [echo] ${newstring} == ;C:\temp\dp\util\stack
> 
> 
> Regards, Gilbert
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/ant-regex-tf3910621.html#a11109055
Sent from the Ant - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to