projects
/
spider.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fiz strange carp errors on startup with no route_*_cache files
[spider.git]
/
perl
/
BadWords.pm
diff --git
a/perl/BadWords.pm
b/perl/BadWords.pm
index 09911b4ad5748bfde84a4e502aac9a823c044c48..446bcf1e4f06ca9996504bcbd3445971c27bde80 100644
(file)
--- a/
perl/BadWords.pm
+++ b/
perl/BadWords.pm
@@
-135,7
+135,7
@@
sub generate_regex
my $res;
@relist = sort {$a->[0] cmp $b->[0]} @relist;
for (@relist) {
my $res;
@relist = sort {$a->[0] cmp $b->[0]} @relist;
for (@relist) {
- $res .= qq{(?:$_->[1]) |\n};
+ $res .= qq{
\\b
(?:$_->[1]) |\n};
}
$res =~ s/\s*\|\s*$//;
$regex = qr/\b($res)/x;
}
$res =~ s/\s*\|\s*$//;
$regex = qr/\b($res)/x;
@@
-211,7
+211,7
@@
sub check
if ($regex) {
my %uniq;
if ($regex) {
my %uniq;
- @out = grep {++$uniq{$_}; $uniq{$_} == 1 ? $_ : undef }($s =~ /
\b
($regex)/g);
+ @out = grep {++$uniq{$_}; $uniq{$_} == 1 ? $_ : undef }($s =~ /($regex)/g);
dbg("BadWords: check '$s' = '" . join(', ', @out) . "'") if isdbg('badword');
return @out;
}
dbg("BadWords: check '$s' = '" . join(', ', @out) . "'") if isdbg('badword');
return @out;
}