mirror of
https://github.com/pragma-/pbot.git
synced 2024-11-26 22:09:26 +01:00
Use re2 for regfind and factfind
This commit is contained in:
parent
58f21b3bf7
commit
278fffdad6
@ -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';
|
||||
|
@ -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} }) {
|
||||
|
Loading…
Reference in New Issue
Block a user