[erlang-questions] improving the performance of regexp(regular expressions)

Kevin Scaldeferri <>
Fri Jul 4 19:50:58 CEST 2008


On Jul 4, 2008, at 8:53 AM, Darren New wrote:

> David Mitchell wrote:
>> Pre-R12B-3, I had a lot of success using pattern matches in  
>> situations
>> where my initial reaction was to use regex.
>
> The place where a regex really shines is when it's generated at  
> runtime.
> A regex literal can be replaced by code. A regex read from a
> configuration file is much harder to replace with code (altho less  
> so in
> Erlang than some other languages). A regex read from the keyboard is
> almost impossible to replace with code.

I think you're misinterpreting regexes.  A regex _is_ code.  Code in a  
specialized, limited-purpose, extremely concise, occasionally obscure/ 
obfuscated language, but code nonetheless.


-kevin



More information about the erlang-questions mailing list