ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Olivier Gies <olivier.g...@bull.net>
Subject Re: regular expressions in Ant
Date Tue, 25 Mar 2008 02:05:16 GMT
Backslashes in Ant need to be escaped, as in any regular Java String:

         <ac:propertyregex property="html_2"
                   input="${html_1}"
                   regexp="\\"
                   replace="\\\\"
                   casesensitive="false"/>

BR,
Olivier

-------- Original Message  --------
Subject: Re: regular expressions in Ant
From: Z W <mpc8250@gmail.com>
To: Ant Users List <user@ant.apache.org>
Date: 25/03/2008 08:35

> I updated with removal of ( from ([\]
> and still get the same error about
> 
> java.util.regex.PatternSyntaxException: Unclosed character class near index 2
> [\]
>   ^
> 
> On Mon, Mar 24, 2008 at 5:24 PM, Z W <mpc8250@gmail.com> wrote:
>> Hi
>>
>> I have trouble converting \ to \\,  for example in
>> \\filer\Test\PaC\M2\5.3, to   \\\\filer\\Test\\PaC\\M2\\5.3.
>> I tried with ant-contrib's
>>        <ac:propertyregex property="html_2"
>>                  input="${html_1}"
>>                  regexp="([\]"
>>                  replace="\\"
>>                  casesensitive="false"/>
>>
>> But I get errors
>> C:\main.xml:452: java.util.regex.PatternSyntaxException: Unclosed
>> character class near index 3 ([\]
>>
>>
>>  ^
>>
>>
>> Thanks for sharing
>>
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
> 
> 

-- 
*Olivier Gies*

*Delivery Manager
Customs & Tax Software Engineering Center
Bull, Architect of an Open World ^TM
Phone: +86 (10) 65978001 - Ext 555 *

*www.bull.com <http://www.bull.com/>*

*This e-mail contains material that is confidential for the sole use of
the intended recipient. Any review, reliance or distribution by others
or forwarding without express permission is strictly prohibited. If you
are not the intended recipient, please contact the sender and delete all
copies.*


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message