in reply to regex for swear filter
The word anchor \b matches a boundary between a word character and a +non-word character \w\W or \W\w: $x = "Housecat catenates house and cat"; $x =~ /\bcat/; # matches cat in 'catenates' $x =~ /cat\b/; # matches cat in 'housecat' $x =~ /\bcat\b/; # matches 'cat' at end of string
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: regex for swear filter
by Anonymous Monk on Feb 13, 2004 at 04:29 UTC | |
by halley (Prior) on Feb 13, 2004 at 12:46 UTC | |
by Abigail-II (Bishop) on Feb 13, 2004 at 13:19 UTC | |
by halley (Prior) on Feb 13, 2004 at 14:16 UTC | |
by Abigail-II (Bishop) on Feb 13, 2004 at 16:59 UTC |