preg_match_all and html

Hello all,

I am trying to use preg_match_all to eliminate some html code.


preg_match_all('/<span class="news_home_list">(.*?)<br>(.*?)/<img src="\\/images\\/grammi.gif" width="100%" height="2px">(.*?)<\\/span>.*?/s', $html, $posts, PREG_SET_ORDER);

I am receiving the following error message:
Warning: preg_match_all() [function.preg-match-all]: Unknown modifier ‘<’ on line 97

Before I received the error, the code was working but then I added:


<br><img src="/images/grammi.gif" width="100%" height="2px">

I tried adding escapes but it still gives me the same error.

Can someone explain what I am doing wrong?

Thanks that worked. Now I can regain my sanity!

The problem is that you’re using a pattern delimiter (the /) accidentally within the regex.

&#8230;[COLOR="DimGray"]<br>(.*?)[/COLOR][color=#CC9900]/[/color][COLOR="DimGray"]<img src="[/COLOR]&#8230;
          ^