Trouble with exclusion in regular expressions
Posted: Mon Sep 16, 2002 5:09 pm
I've been going through some tutorials on the subject of regular expressions, but I can't seem to find anything explaining what I'm trying to do.
For the purposes of a larger script I'm working on, I need to match all text that does not fall between certain HTML tags. I'd like to be able to set a variable equal to these excluded tags, i.e.
so that other folks can customize it to their liking.
My problem is that I can't seem to figure out how to use regex to say "Match everything except what falls between these tags".
Any ideas? Thanks in advance.
For the purposes of a larger script I'm working on, I need to match all text that does not fall between certain HTML tags. I'd like to be able to set a variable equal to these excluded tags, i.e.
Code: Select all
$excluded_tags = '(pre|blockquote)'My problem is that I can't seem to figure out how to use regex to say "Match everything except what falls between these tags".
Any ideas? Thanks in advance.