[\] is open-character-class right-bracket. The exception is that you are
missing a ']', making the pattern [\]] - matching a single right-bracket.
You mean [\\], or more simply \\.
To turn backslash into double backslash, try: regexp="\\" replace="\\\\"
-----Original Message-----
From: Z W [mailto:[EMAIL PROTECTED]
Sent: Mon 2008-03-24 20:34
To: Ant Users List
Cc:
Subject: Re: regular expressions in Ant
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]
***********************************************************************
Bear Stearns is not responsible for any recommendation, solicitation,
offer or agreement or any information about any transaction, customer
account or account activity contained in this communication.
***********************************************************************
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]