Regex help

Normally I can figure these out but apparently I am not normal.
This is in the string that I want to replace,

<ul id="tabsF"> 
<li><a href="javascript:showGeneral();"><span>General</span></a></li> 
<li><a href="javascript:show1();"><span>#1</span></a></li> 
<li><a href="javascript:show2();"><span>#2</span></a></li> 
<li><a href="javascript:showAdvanced();"><span>Advanced</span></a></li> 

And my regex,

$data = preg_replace("|<ul id=\\"tabsF\\">(.*?)</ul>|msx", ' ', $data);

I have been working on this for a loooong time if someone can point out what I am doing wrong I would be grateful.

Thanks, works a treat. This saves a flat spot on my forehead.

When the x modifier (PCRE_EXTENDED) is used, whitespace in the pattern is ignored. In your case, that makes the pattern effectively: <ulid=…

Since you’re not needing to make use of that modifier for any reason, the simplest solution is remove it. Also, the m modifier (PCRE_MULTILINE) will not have any effect here, so again you can simply remove it; making the only pattern modifier that you want is s (PCRE_DOTALL).

More info: