The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

re::engine::RE2 - RE2 regex engine

SYNOPSIS

    use re::engine::RE2;

    if ("Hello, world" =~ /Hello, (world)/) {
        print "Greetings, $1!";
    }

DESCRIPTION

Replaces / arguments perl's regex engine in a given lexical scope with RE2.

Rather under development, this is just to show it's possible!

See http://github.com/dgl/re-engine-RE2

METHODS

To access extra functionality of RE2 methods can be called on a compiled regular expression (i.e. a qr//).

  • possible_match_range([length = 10])

    Returns an array of two strings: where the expression will start matching and just after where it will finish matching. See RE2's documention on PossibleMatchRange for further details.

    Example:

        my($min, $max) = qr/^(a|b)/->possible_match_range;
        is $min, 'a';
        is $max, 'c';'

AUTHORS

David Leadbeater <dgl[at]dgl[dot]cx>

COPYRIGHT

Copyright 2010 David Leadbeater.

Based on re::engine::PCRE:

Copyright 2007 Ævar Arnfjörð Bjarmason.

The original version was copyright 2006 Audrey Tang <cpan@audreyt.org> and Yves Orton.

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.