Regular Expression is not working properly
Posted: Tue May 24, 2005 11:54 pm
Hi,
I am doing an admin panel for flash using PHP and XML, here I am using regular expression to find and replace text in the xml file.
This is the code I am using the find and replace operation
$string = "<page><![CDATA[".$text."]]></page>";
$pattern = "/<page>(.)*<\/page>/";
$contents = preg_replace($pattern,$string,$contents);
here “$text” content from textarea
if I am giving small text content it’s working fine, if I am giving four or more lines then this regular expression is not working properly.
please help me to rectify this issue....
Thanks in advance.
I am doing an admin panel for flash using PHP and XML, here I am using regular expression to find and replace text in the xml file.
This is the code I am using the find and replace operation
$string = "<page><![CDATA[".$text."]]></page>";
$pattern = "/<page>(.)*<\/page>/";
$contents = preg_replace($pattern,$string,$contents);
here “$text” content from textarea
if I am giving small text content it’s working fine, if I am giving four or more lines then this regular expression is not working properly.
please help me to rectify this issue....
Thanks in advance.