Page is a not externally linkable
- Code, Content, and Presentation
-- PHP Server Side Scripting
---- need help with preg replace


coopster - 8:53 pm on Dec 26, 2008 (gmt 0)


Yeah, I was thinking about that when I threw the expression down the first time. I was actually going to do that for you but when you said the word was in paragraph tags I figured that was it, nothing more, so I left it as is. Are you certain you want your second tag marker like that? The regex as is with the end tag marker match of
[^>]* will not match on something like

<p>Hello there <b>darkage</b>!</p>
I would think you will want to keep the dot metacharacter there. If not, since you are no longer using the dot metacharacter you can drop that "s" modifier.

You shouldn't need that ungreedy modifier. Were you having unexpected results without it?


Thread source:: http://www.webmasterworld.com/php/3814557.htm
Brought to you by WebmasterWorld: http://www.webmasterworld.com