ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Vallon, Justin" <jval...@bear.com>
Subject RE: regular expressions in Ant
Date Tue, 25 Mar 2008 02:09:04 GMT
[\] 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:mpc8250@gmail.com] 
	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 <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 



***********************************************************************
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: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message