[erlang-questions] builtin regexp functions in Erlang/OTP R12B-3
Mats Cronqvist
mats.cronqvist@REDACTED
Mon Jun 16 17:53:06 CEST 2008
Kenneth Lundin wrote:
> Hi,
>
> Regarding the new "experimental" builtin regexp functions in the re
> module our intention is
> to provide a fully working implementation where we want feedback on
> the API functions and also other feedback.
> With "experimental" we don't mean very buggy or low quality but rather
> that the API's are not stabilized yet and that there
> are a few optimizations more to do.
>
> Our intention with releasing this regexp implementation before the
> API's are 100% settled is that we believe
> we can get more and better comments if people actuall can try
> themselves to use the functions.
>
> We would appreciate if we get the comments in relation to the
> EEP 11 Built in regular expressions in Erlang
> http://www.erlang.org/eeps/eep-0011.html which is especially written
> for this purpose.
i'd like to add this the EEP11;
since implementing regular expressions with backreferences is an
NP-complete problem, "re" disallows backreferences. this is achieved by
calling pcre_fullinfo() and requiring that PCRE_INFO_BACKREFMAX == 0.
from http://www.pcre.org/pcre.txt:
int pcre_fullinfo(const pcre *code, const pcre_extra *extra,
int what, void *where);
[...]
The possible values for the third argument are defined in pcre.h, and
are as follows:
PCRE_INFO_BACKREFMAX
Return the number of the highest back reference in the pattern. The
fourth argument should point to an int variable. Zero is returned if
there are no back references.
More information about the erlang-questions
mailing list