5.10 regex pragmata

By Ævar Arnfjörð Bjarmason (‎avar‎)
Date: Thursday, 30 August 2007 14:10
Duration: 20 minutes
Target audience: Advanced
Language:


perl 5.10 has a facility which makes it possible to lexically swap out
its regular expression engine for another one. This allows module
authors to write alternative regex engines that work with the C<m//>,
C<s///>, C<split //> constructs and other things that use regexes.

This talk will briefly cover how the internal API works (as described
in L<perlreapi>), but it's mostly going to be a I<what you can do> not
I<how to do it> talk.

I'll take practical examples of alternative engines already on CPAN[1]
such as re::engine::POSIX and re::engine::Plan9. The majority of the
talk will be devoted to practical examples of what the new API allows
enables module authors to do, most of this will be demonstrated with
small snippets that use re::engine::Plugin since showing the audience
a simple example in pure Perl will go down a lot better than one in C/XS.

These examples will mostly focus on things that the perl regex engine
doesn't implement but are possible with the API, such as matching a
regex against a file handle, implementing capture variables that are
match objects (like re::engine::PCR does), assigning to capture
variables to alter the pattern being matched against and more.

1. http://search.cpan.org/search?query=re%3A%3Aengine


Copyright © 2003-2007 Verein 'Vienna.pm - Verein zur Förderung der Programmiersprache Perl'.
To contact the organisers send an email to vienna2007@yapceurope.org
Impressum