3
0
mirror of https://github.com/pragma-/pbot.git synced 2024-11-29 15:29:32 +01:00

Plugins/TypoSub: allow, but ignore, trailing characters after a s/// closed sub

This commit is contained in:
Pragmatic Software 2020-02-07 11:22:16 -08:00
parent 165099b035
commit d92f690195

View File

@ -57,7 +57,7 @@ sub on_public {
if ($msg =~ m/^\s*s([[:punct:]])/) { if ($msg =~ m/^\s*s([[:punct:]])/) {
my $separator = $1; my $separator = $1;
my $sep = quotemeta $separator; my $sep = quotemeta $separator;
if ($msg =~ m/^\s*s${sep}(.*?)(?<!\\)${sep}(.*?)(?<!\\)${sep}([g]*)\s*$/ or $msg =~ m/^\s*s${sep}(.*?)(?<!\\)${sep}(.*?)$/) { if ($msg =~ m/^\s*s${sep}(.*?)(?<!\\)${sep}(.*?)(?<!\\)${sep}([g]*).*$/ or $msg =~ m/^\s*s${sep}(.*?)(?<!\\)${sep}(.*)$/) {
my ($regex, $replacement, $modifiers) = ($1, $2, $3); my ($regex, $replacement, $modifiers) = ($1, $2, $3);
eval { eval {
my $rx = qr/$regex/; my $rx = qr/$regex/;