Jump to content

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


obsidian

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?
Link to comment
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.
Link to comment
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!
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

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.