|go ahead... be a heretic|
Please help with Regexp::Commonby scorpio17 (Canon)
|on Jan 18, 2017 at 23:26 UTC||Need Help??|
scorpio17 has asked for the wisdom of the Perl Monks concerning the following question:
I'm trying to teach myself how to use Regexp::Common, and I'm having a little trouble.
The following works as expected, and finds the number 1234 embedded in the string aaaa1234cccc:
However, this does NOT work as I would expect:
In this case, change XXXX into your favorite 4 letter offensive word. If I change the data string to this: "aaaa XXXX cccc" (i.e., add spaces around the XXXX, then it finds it).
It seems like the profanity patterns have start of word / end of word anchors built into the patterns, and thus don't work if the word is embedded inside another string? Is there any way to control this behavior? I've gone through the docs, but so far I can't find a way.
I'm using perl 5.14 (activestate) on Win7. Thanks for any push in the right direction.