ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Brian Agnew <br...@oopsconsultancy.com>
Subject Re: Regular expression to match non-breaking spaces
Date Fri, 11 Mar 2011 23:48:29 GMT
You might want to try XMLTask, which reads XML natively and handles the 
specified character encodings. It'll do regexp replacements.

http://www.oopsconsultancy.com/software/xmltask

On 11/03/2011 18:26, Peter Desjardins wrote:
> Hi. I'm trying to replace every non-breaking space character in a file
> with a normal space character. The source file is encoded using UTF-8.
> I can't get this to work using the replaceregexp task. Here's the
> syntax I'm using:
>
>    <replaceregexp file="myfile.xml" match="&#xa0;" replace=" "
> flags="g" byline="true" encoding="utf-8" />
>
> I've tried other ways to match non-breaking spaces (&#160; \0240
> U+00A0) but have had no success yet. I didn't alter the regular
> expression libraries in my Ant installation. Is that what I need to
> do? Or is there a string I can put into the match attribute that will
> match UTF-8 non-breaking spaces?
>
> Thanks for your help.
>
> Peter Desjardins
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
>

-- 
Brian Agnew                  http://www.oopsconsultancy.com
OOPS Consultancy Ltd
Tel: +44 (0)7720 397526
Fax: +44 (0)20 8682 0012


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


Mime
View raw message