[erlang-questions] regexp sux!

Luke Gorrie luke.gorrie@REDACTED
Sun May 20 17:16:23 CEST 2007


In fact my requirements are as simple as:
1. available in the next few hours :-)
2. can't be wedged by bad input (e.g. "x**" infinite loop),
   since I want to use user-configurable regexps

Quick measurement suggests that performance of the OTP regexp module
is more than ample as it tuns out. I'm doing very many repetitions of
matching short strings (phone numbers) with simple patterns (e.g. 20
permitted prefix'ish patterns).

But "x**" divergence is a big problem with regexp.erl. I will have to
leave the feature undocumented if I use that module.

The existing code I'm trying to optimise is written in a "little
language" that's byte-compiled to a virtual machine that's written in
Erlang (Working with Tony is never dull :-)). My Plan A is to add an
efficient regexp primitive to the language instead of else-if chains.
Plan B is to compile it to native Erlang instead of bytecode.

More information about the erlang-questions mailing list