3
0
mirror of https://github.com/pragma-/pbot.git synced 2024-12-23 03:02:47 +01:00

Use boundaries instead of \W

This commit is contained in:
Pragmatic Software 2010-05-15 22:56:19 +00:00
parent 629d1c7286
commit 525588b8f1

View File

@ -175,7 +175,7 @@ while($subcode =~ m/^\s*(and)?\s*replace\s*'.*'\s*with\s*'.*'/i) {
my $ret = eval {
my $got_change;
while($code =~ s/(\W)$from(\W)/$1$to$2/) {
while($code =~ s/(\b)$from(\b)/$1$to$2/) {
$got_change = 1;
}
return $got_change;