Jump to content

Archived

This topic is now archived and is closed to further replies.

obsidian

*SOLVED* Matching Quotes -- Effigy, where are you???

Recommended Posts

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?

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
[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!

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.