View Single Post
  #6 (permalink)  
Old 05-21-2008, 04:26 AM
KevinADC KevinADC is offline
Learning Programmer
 
Join Date: Jan 2007
Posts: 94
Credits: 0
Rep Power: 8
KevinADC is on a distinguished road
Default Re: Regex Expressions

The regexp works.

Code:
$string = '<![CDATA[this is a test]]>';
$string =~ s/<!\[CDATA\[(.*?)\]\]>/$1/gis;
print $string;
The problem is more than likely because your pattern is spread over multiple lines. Post a sample of the real data.
Reply With Quote