Clear questions and runnable code get the best and fastest answer |
|
PerlMonks |
Blacklisting with a Regular Expressionby BenjiSmith (Novice) |
on Aug 18, 2005 at 21:52 UTC ( [id://484969]=perlquestion: print w/replies, xml ) | Need Help?? |
BenjiSmith has asked for the wisdom of the Perl Monks concerning the following question:
I have a tricky regular expression problem that, as it turns out, may not actually be possible. (But if it is possible, I'm sure someone here will know the answer.) Here's what the problem boils down to...
Anyone have any ideas? I've been tinkering with negative lookahaed (which is not my strong suit), but I don't think that's the right approach. Ideally, what I'd prefer to do is to just search for the blacklist tokens and then negate the result of my match (so that CLEAN strings always return true), but unfortunately, I'm working with a large established codebase, and the regexes are loaded at runtime. I can't modify any of the surrounding code except the regex itself, and I need the expression to match on strings which don't contain any of the tokens in the set. Very tricky. Thanks for your help. --Benji
Back to
Seekers of Perl Wisdom
|
|