aboutsummaryrefslogtreecommitdiff
path: root/TokensV2.pm
diff options
context:
space:
mode:
Diffstat (limited to 'TokensV2.pm')
-rw-r--r--TokensV2.pm18
1 files changed, 9 insertions, 9 deletions
diff --git a/TokensV2.pm b/TokensV2.pm
index 619d7df..c38ef39 100644
--- a/TokensV2.pm
+++ b/TokensV2.pm
@@ -36,7 +36,7 @@ sub digest_single { # $target, $regex, $eaten_left_literal_chars, $eaten_right
return unless ($_[2]+$_[3])/$literal_char_count<0.999999;
return @{$DIGEST_SINGLE[$_[2]][$_[3]]} if defined $DIGEST_SINGLE[$_[2]][$_[3]];
pos($_[0]) = undef;
- goto VISITING unless $_[0] =~ /(${_[1]})/g;
+ goto VISITING unless $_[0] =~ /(${_[1]})/g; # SUCCESSFULL MATCH
my $digit = 2;
while( my $cg = eval '$'.$digit++ ) {
my @suspicious_tokens = $cg =~ /$long_tokens/g;
@@ -152,17 +152,17 @@ sub parse {
@MASK = ();
my $target = shift;
my $regex = shift;
- while($regex =~ /^(.+)$/mg) {
- my $_ = $1;
- my $other = $_;
+ while($regex =~ /^(.+)$/mog) {
+ my $underscore = $1;
+ my $other = $underscore;
# strip out non-literal chars from MASK
- $other =~ s/\(\?:(.+?)\)\+/\1/g;
- $other =~ s/\(\?:(.+?)\)\?/\1/g;
- $other =~ s/\.\*\?//g;
+ $other =~ s/\(\?:(.+?)\)\+/\1/og;
+ $other =~ s/\(\?:(.+?)\)\?/\1/og;
+ $other =~ s/\.\*\?//og;
push @MASK, $other;
# surround wildcards with capturing group for REGEX
- s/(\.\*\?)/\(\1\)/g;
- push @REGEX, $_;
+ s/(\.\*\?)/\(\1\)/og;
+ push @REGEX, $underscore;
}
$long_tokens = '\b' . join '\b|\b', grep length>=3,keys %{+{ map +($_=>undef), map /\w+/g, @REGEX }};

Return to:

Send suggestions and report system problems to the System administrator.