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 <[EMAIL PROTECTED]>
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 <[EMAIL PROTECTED]> 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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



--
*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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to