Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

robin (1821)

robin
  (email not shown publicly)
about:blank

Journal of robin (1821)

Saturday April 20, 2002
07:52 AM

More recursion

[ #4336 ]
I've rewritten my recursive regex implementation, and I think it actually works properly at last.

I have started wondering about the feasibility of replacing perl's regex engine with PCRE. The regex engine is supposedly pluggable already, but it looks as though plugging in a completely different regex engine would still be non-trivial. Any thoughts?

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.

  • Perl 5.12

          ...now with Perl Compatible Regular Expressions!

    :)

    I realize that you're serious, but it's funny anyhow...

    -matt
  • How hard would it be to make a module that caused all regular expressions lexically to use PCRE rather than the default one?

    Just a thought. And secondly, what are the benchmarks like?
    • How hard would it be to make a module that caused all regular expressions lexically to use PCRE rather than the default one?

      Doing it lexically would be trickier, because you'd have to either add a new set of OPs for the PCRE versions, or at least a flag for the existing ones. I was thinking it would be more along the lines of use re 'debug'; (which is to say, not lexically scoped).

      The first stage is to write a simple XS interface to PCRE, and then we can do some sensible benchmarks as well.

  • I really enjoyed the recursive regex page.

    You mention:

    The cure for this ill is to allow capturing groups to be named rather than numbered, and to decree that such a name remains in scope until another group is encountered using the same name.

    .. while talking about compositionality. Has anyone looked at implementing this in either the Perl5 engine or PCRE? Is anyone planning to? I'd like to have a crack at it, but it'll probably take a long time and be horrifically messy; though I've studied Kleene Alge

    --
    $a="printf.net"; Chris Ball | chris@void.$a | www.$a | finger: chris@$a
  • This is obviously something I've been thinking about recently. My concerns are mainly to do with what parts of Perl expect various things from the structure of a REGEXP*. For instance, many of the regexp magic variables ($+ and the like) dive into the REGEXP* structure directly. That may not be too much of a problem, since you can use optimize.pm to dike out those GVSVs and replace them with calls to a function in the re::pcre library.

    So other than that, it ought to be pretty plain sailing. If you're goi