From 278fffdad68ce43c9dc05496585dd20dc883019a Mon Sep 17 00:00:00 2001 From: Pragmatic Software Date: Sat, 9 Sep 2017 22:37:11 -0700 Subject: [PATCH] Use re2 for regfind and factfind --- PBot/FactoidCommands.pm | 1 + PBot/RegistryCommands.pm | 1 + 2 files changed, 2 insertions(+) diff --git a/PBot/FactoidCommands.pm b/PBot/FactoidCommands.pm index 09cf6440..de36976e 100644 --- a/PBot/FactoidCommands.pm +++ b/PBot/FactoidCommands.pm @@ -1175,6 +1175,7 @@ sub factfind { $last_chan = ""; $i = 0; eval { + use re::engine::RE2 -strict => 1; my $regex = ($arguments =~ m/^\w/) ? '\b' : '\B'; $regex .= quotemeta $arguments; $regex .= ($arguments =~ m/\w$/) ? '\b' : '\B'; diff --git a/PBot/RegistryCommands.pm b/PBot/RegistryCommands.pm index d64bc1f0..179ae723 100644 --- a/PBot/RegistryCommands.pm +++ b/PBot/RegistryCommands.pm @@ -164,6 +164,7 @@ sub regfind { $last_section = ""; $i = 0; eval { + use re::engine::RE2 -strict => 1; foreach my $section_key (sort keys %{ $registry }) { next if defined $section and $section_key !~ /^$section$/i; foreach my $item_key (sort keys %{ $registry->{$section_key} }) {