obsidian Posted October 10, 2006 Share Posted October 10, 2006 ok, here's the situation, i am struggling to come up with something that will match [b]all[/b] quotes [b]not contained within an HTML tag[/b]. sounds pretty straight forward, right? well, as variable length look behinds are not supported yet, i'm really struggling with how best to do this. is there anyone that can come up with a way to handle this with a single regular expression for preg_match_all(), or do i need to do this incrementally? Quote Link to comment Share on other sites More sharing options...
effigy Posted October 11, 2006 Share Posted October 11, 2006 What about [url=http://www.phpfreaks.com/forums/index.php/topic,99040.0.html]this[/url]? It's not quotes, but it has the same concept of isolating the HTML tags from the regex.I don't think this can be done with a single regex unless recursive callbacks are used. Quote Link to comment Share on other sites More sharing options...
obsidian Posted October 11, 2006 Author Share Posted October 11, 2006 [quote author=effigy link=topic=111117.msg450451#msg450451 date=1160574871]What about [url=http://www.phpfreaks.com/forums/index.php/topic,99040.0.html]this[/url]? It's not quotes, but it has the same concept of isolating the HTML tags from the regex.I don't think this can be done with a single regex unless recursive callbacks are used.[/quote]excellent. i was hoping to be able to do it all with a preg_replace(), but from what i understand after checking with a couple gurus here at work, it's not possible with a single regular expression without variable length lookaround support.thanks for the quick fix, though! 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.