[erlang-questions] Improved regexp.erl

Robert Virding <>
Wed Oct 18 02:38:14 CEST 2006

Hi Yariv,

No serious benchmarks, only small tests. Comparing doing regexp:parse to 
regexp:compile and then regexp:matches on a large file (400kB) I found 
small speed up on straight regexps like "abc", and large speed up for 
regexps with many alternatives like "[a-z]+".

No binaries yet. Not difficult to do if you can accept doing either pure 
lists OR a binary. Doing iolists becomes complicated. This keeping the 
same interface as now.

Also planning to do a parse transform which compiles regexp into code 
within the module. Similar code to what leex generates. This will be 
better at compile time as there wil be no need to build a structure to 
interpret at runtime as regexp:compile does. This is really not 
difficult either.

If I can find my old parse transform identity function.


Yariv Sadan wrote:
> Hi Robert,
> Thanks for the new regexp module! Have you ran any benchmarks
> comparing its performance to the old module? Also, I remember your
> mentioning it would be able to work with binaries. Is that capability
> implemented?
> Thanks
> Yariv
> On 10/17/06, Robert Virding <> wrote:
>> I have added an upgraded, drop-in replacement to the user contributions
>> in trapexit.org. It allows for compilation of regular expressions. They
>> can either be used directly in the functions in the module, as with
>> regexp:parse, or the DFA built from the regexps can be returned. Read
>> the documentation.
>> Robert
>> _______________________________________________
>> erlang-questions mailing list
>> http://www.erlang.org/mailman/listinfo/erlang-questions

More information about the erlang-questions mailing list