Parse-RPN

 view release on metacpan or  search on metacpan

README  view on Meta::CPAN

             return a with .1.3.6.1.2.1.25.3.3.1.2.768,.1.3.6.1.2.1.25.3.3.1.2.769,.1.3.6.1.2.1.25.3.3.1.2.771,.1.3.6.1.2.1.25.3.3.1.2.770
             and b with 48,38,42,58

             !!! becare, if you need to use : as a regex, you need to backslash to prevent overlap with new dictionary entry
             SPLIT return the matched value WITHOUT the empty string of the beginning

   aa bb SSPPLLIITT
             return all splitted item of 'a' by the separator 'b'
             'b' is a REGEX
             !!! becare, if you need to use : as a regex, you need to backslash to prevent overlap with new dictionary entry
             !!! if the split match on the beginning of string,
             SPLIT return the matched value WITHOUT the empty string of the beginning

   aa bb SSPPLLIITTII
             return all splitted item of 'a' by the separator 'b'
             'b' is a REGEX case insensitive
             !!! becare, if you need to use : as a regex, you need to backslash to prevent overlap with new dictionary entry
             !!! if the split match on the beginning of string,
             SPLIT return the matched value WITHOUT the empty string of the beginning

   aa bb PPAATT
             return one or more occurance of 'b' in 'a'
             'b' is a REGEX
             !!! becare, if you need to use : as a regex, you need to backslash to prevent overlap with new dictionary entry

   aa bb PPAATTII
             return one or more occurance of 'b' in 'a'
             'b' is a REGEX case insensitive

lib/Parse/RPN.pm  view on Meta::CPAN

    $var{ $v2 } = \@T2;
    my @ret;
    return \@ret, 5, 0;
};

=head2 a b SPLIT

      return all splitted item of 'a' by the separator 'b' 
      'b' is a REGEX 
      !!! becare, if you need to use : as a regex, you need to backslash to prevent overlap with new dictionary entry
      !!! if the split match on the beginning of string,
      SPLIT return the matched value WITHOUT the empty string of the beginning
        
=cut

$dict{SPLIT} = sub {
    my $work1 = shift;
    my $a     = pop @{ $work1 };
    my $b     = pop @{ $work1 };
    my @r     = grep /[^(^$)]/, split /$a/, $b;
    my @ret;
    push @ret, @r;
    return \@ret, 2, 0;
};

=head2 a b SPLITI

      return all splitted item of 'a' by the separator 'b' 
      'b' is a REGEX case insensitive
      !!! becare, if you need to use : as a regex, you need to backslash to prevent overlap with new dictionary entry
      !!! if the split match on the beginning of string,
      SPLIT return the matched value WITHOUT the empty string of the beginning
      
=cut

$dict{SPLITI} = sub {
    my $work1 = shift;
    my $a     = pop @{ $work1 };
    my $b     = pop @{ $work1 };
    my @r     = grep /[^(^$)]/, split /$a/i, $b;
    my @ret;



( run in 1.101 second using v1.01-cache-2.11-cpan-71847e10f99 )