Forum Moderators: coopster
The content is like this:
<span class=a>.....</span>
<a class=fl href="www.example.com">....</a>
<table>....</table>
<a class=fl href="www.example.com">....</a>
The regex i wrote:
<span class=a>(.*?)</span><a class=fl(.*?)</a>(.*?)<a class=fl(.*?)</a>
By using regex verifier software, the regex i use seems to be valid, but after executing it, it says "Unknown modifier".
Do you have any idea what happens? I've spent an hour on this, but still have no idea. Any help is highly appreciated. Thanks thanks!
$output = eregi_replace("<span class=a>(.*?)</span><a class=fl(.*?)</a>(.*?)<a class=fl(.*?)</a>", "hello word", $output);
and...
$output = preg_replace("/<span class=a>(.*?)</span><a class=fl(.*?)</a>(.*?)<a class=fl(.*?)</a>/is", "hello world", $output);
but it seems both sentences doesn't work too. very frustrated.....
If you need to extract some information from the code, you should use preg_match() or preg_match_all(), and work with the "matches" array.