XP is just a number | |
PerlMonks |
regex negation without !~by Anonymous Monk |
on May 24, 2007 at 19:14 UTC ( [id://617317]=perlquestion: print w/replies, xml ) | Need Help?? |
Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
Hi, I'd like to use a regex to filter out everything except a fixed string, say "accept everything except 'FOO'". I can easily do this with $str !~ /^FOO$/. But my problem is that I can't use !~, I have to use =~ because I'm passing the pattern to some other code. How do I do that?, I tried $str =~ /^^FOO$/ or /^^F^O^O$/, they certain don't do the right thing. Thanks
Back to
Seekers of Perl Wisdom
|
|