From a1c5be0bff39d3c00452ad25e023caf49eb6a0e2 Mon Sep 17 00:00:00 2001 From: Ryan Voots Date: Sat, 31 Oct 2020 02:00:26 -0400 Subject: [PATCH] minor fixes --- plugins/factoids.pm | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/plugins/factoids.pm b/plugins/factoids.pm index db51c3c..87361ca 100644 --- a/plugins/factoids.pm +++ b/plugins/factoids.pm @@ -196,11 +196,7 @@ sub sub_command ($self, $said, $pm) { if (!$call_only && $subject =~ s/^\s*($commands_re)\s*//) { $fact_string = $commandhash{$1}->($self, $subject, $said->{name}, $said); - } elsif (($subject =~ m{\w\s*=~\s*s /.+ / .* /[gi]*\s*$}ix) - || ($subject =~ m{\w\s*=~\s*s\|.+\| .*\|[gi]*\s*$}ix) - || ($subject =~ m{\w\s*=~\s*s\{.+\}\{.*\}[gi]*\s*$}ix) - || ($subject =~ m{\w\s*=~\s*s <.+ > <.* >[gi]*\s*$}ix) - || ($subject =~ m{\w\s*=~\s*s\(.+\)\(.*\)[gi]*\s*$}ix)) + } elsif ($subject =~ m{\w\s*=~\s*(s.*)$}ix) { $fact_string = $self->get_fact_substitute($subject, $said->{name}, $said); } elsif (!$call_only and $subject =~ /\s+$COPULA_RE\s+/) { @@ -555,7 +551,10 @@ sub get_fact_substitute ($self, $subject, $name, $said) { my ($aliasserver, $aliasnamespace) = $self->get_alias_namespace($said); my ($server, $namespace) = $self->get_namespace($said); - if ($said->{body} =~ m{^(?:\s*substitute)?\s*(.*?)\s*=~\s*s(.*)$}ix) + # my $m = $said->{body} =~ m{^(?:\s*substitute)?\s*(.*?)\s*=~\s*(s.*)$}ix; + #return $said->{body} . "$m $1 $2"; + + if ($said->{body} =~ m{^(?:\s*substitute)?\s*(.*?)\s*=~\s*(s.*)$}ix) { my ($subject, $regex) = ($1, $2); my $pdoc = PPI::Document->new(\$regex);