sanfly Posted January 20, 2007 Share Posted January 20, 2007 HiIve only used a tiny bit of regex in the past, but I feel like this should be easy but Ive tried a million different things and just cant get it.ive used regex successfully to remove all tags in a string using the following[code=php:0]$pattern = "|\<(.*?)>|s";$c_desc2 = preg_replace($pattern, "", $c_desc2)[/code]However, I want to be able to leave the line break tags <br /> in, and cant figure out how to make the exception. Can anyone help?Cheers Quote Link to comment Share on other sites More sharing options...
effigy Posted January 20, 2007 Share Posted January 20, 2007 [tt]|<(?!br)(.+?)>|s[/tt] Quote Link to comment Share on other sites More sharing options...
sanfly Posted January 20, 2007 Author Share Posted January 20, 2007 Works great, Thanks ;D Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.