[pcre-dev] [Bug 632] New: pcre_compile has no way to give le…

Kezdőlap
Üzenet törlése
Szerző: Sean Middleditch
Dátum:  
Címzett: pcre-dev
Tárgy: [pcre-dev] [Bug 632] New: pcre_compile has no way to give length of source
------- You are receiving this mail because: -------
You are on the CC list for the bug.

http://bugs.exim.org/show_bug.cgi?id=632
           Summary: pcre_compile has no way to give length of source
           Product: PCRE
           Version: N/A
          Platform: Other
        OS/Version: Linux
            Status: NEW
          Severity: bug
          Priority: medium
         Component: Code
        AssignedTo: ph10@???
        ReportedBy: elanthis@???
                CC: pcre-dev@???



It would be very useful for performance reasons to have a pcre_compile
variation that accepted a length for the regular expression source. I am
parsing strings in a Perl-ish notiation (e.g. /foo/mi). Because I can't modify
the original strings to replace the end marker (e.g. the second /) with a NUL
byte, I have to make a copy of the regular expression and pass that to
pcre_compile. I imagine this would be equally useful for many other projects
that do any kind of one-pass language processing that includes Perl-ish regular
expression notation, since such systems often work off of start/end pairs
similar to the sub-expression matches PCRE returns.

I had originally thought of suggesting a pcre_compile variation that took a
Perl-ish notation and parsed out the start/end characters and options on its
own, but that would be less useful in general, as many environments have their
own options they have to parse out anyway (e.g. PHP) so it would still be
common to re-implement the option parsing code no matter what.


--
Configure bugmail: http://bugs.exim.org/userprefs.cgi?tab=email