in reply to Re^2: Regex solution needed
in thread Regex solution needed
-Darinmy @tests = ( "How bout them cocks?", "I'm a big cocks fan", "I love the cocks", "That cocks game was sweet", "Anyone know the cocks score from last night?", "gamecocks rule", "I love the gamecocks, but...", "My favorite cocks player is..." ); foreach my $s (@tests) { if ($s =~ / (?<! \b a ) (?<! \b the ) (?<! \b them ) (?<! \b game ) (?<! \s ) \s* cocks? \b (?! \s fan ) (?! \s game ) (?! \s score ) (?! \s player ) /x) { print "Vulgar: '$s'\n"; } }
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^4: Regex solution needed
by ikegami (Patriarch) on Feb 23, 2007 at 20:13 UTC |