For Programmers: Free Programming Magazines  


Home > Archive > PERL Beginners > June 2005 > RE: Removing *some* XML Character encodings with regular expressi









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author RE: Removing *some* XML Character encodings with regular expressi
Thomas Bätzler

2005-06-08, 8:57 am

Toby Stuart <toby.stuart@figtreesys.com.au> asked:
> I'm trying to remove chars 00-29 from an XML document and
> need a regular expression to do so...
>
> Before: $s = "abc@123";
> After : $s should only contain: "abc@123"


$s =~ s/(&#(\d+);)/$2<=29?"":$1/eg;

HTH,
Thomas
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2009 codecomments.com