TITLE ^

pcre.imc - user interface to Perl-Compatible Regular Expression library

SYNOPSIS ^

    load_bytecode 'library/pcre.imc'
    lib = pcre_init()

    func = find_global 'PCRE', 'compile'
    ( regex, error, errptr )= func( pat, options )

    func = find_global 'PCRE', 'match'
    ( ok, result )= func( regex, string, start, options )

    func = find_global 'PCRE', 'dollar'
    match = func( string, ok, result, i )

DESCRIPTION ^

This is the user interface to PCRE. Use this to initialize the library, compile regexes, match against strings, and return the results. All functions are found in the 'PCRE' namespace.

The NCI interface is contained in libpcre.imc.

sub init()

Intialize the pcre library. The library handle is returned as a PMC and is additionally stored as global 'PCRE', 'lib'.

sub ( regex, error, errptr )= compile( pattern, options )

Compile the string pattern with int options. Returns pmc regex, string error and int errptr.

sub ( ok, result )= match( regex, string, start, options ) sub match ()= match()

Match the pmc regex against string string from int start with int options. Returns the number of matches in int ok and the ovector in pmc result.

sub match= dollar( string, ok, result, i )

Extract from string string the int ith result into string match. Returns the match.

BUGS ^

None known, but this hasn't been well tested. This interface is designed to work on all platforms where PCRE and parrot are supported, but has not been tested on all of them. Send bug reports to <parrotbug@parrotcode.org<gt>

FILES ^

pcre.imc, libpcre.imc

SEE ALSO ^

pcre(3)

AUTHORS ^

Original code by Leo Toetsch, updated by Jerry Gay <jerry dot gay at gmail dot com<gt>

POD ERRORS ^

Hey! The above document had some coding errors, which are explained below:

Around line 168:

You forgot a '=back' before '=head1'


parrot