rrthomas / lrexlib

A Lua (5.1 and later) binding of various regex library APIs (POSIX, PCRE, PCRE2, GNU, Oniguruma and TRE)
Other
160 stars 29 forks source link

Add a pcre2 binding #16

Closed rrthomas closed 7 years ago

rrthomas commented 9 years ago

It would be nice to have a PCRE2 binding: https://lists.exim.org/lurker/message/20150105.162835.0666407a.en.html

PCRE2 is not API-compatible with PCRE, so it would be perfectly natural to add a new flavor for it; it would not make sense to replace the old PCRE binding, as presumably users will still want that for some time to come (even though the changes at the "user" end are smaller).

PCRE2 has some nice features, including "search-and-replace" (which we might want to add to the API), and the ability to have embedded NULs in patterns, subject strings and replacement strings.

shmuz commented 7 years ago

Shouldn't this issue be closed now?

rrthomas commented 7 years ago

Yup! Well done.

data-man commented 7 years ago

@shmuz Is a JIT-compilation supported?

shmuz commented 7 years ago

It should be supported now (jit_compile method has been added). It is still undocumented, see in the source code how to use it.