Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Yeah, what is Perl - Regex? Couldn't they manage to compile regex to pcre?


Yes. perl5 has the possibility to switch to better and faster regex engines, like russ cox' RE2 or pcre with jit support. It's just not done in rperl.

In my perl variant I'm planning to improve the inefficient and overly simple and troublesome Spencer two-pass compiler with backtracking support to use the faster Thompson NFA without backtracking (RE2), and/or switch to pcrejit when no pcre-incompatible ops are used, like unicode character classes. The first pass which calculates the space can be easily used for that.

But a better regex compiler should get away with one-pass and extend the ops dynamically.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: