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

Darren New <>
Fri Jul 4 17:53:33 CEST 2008


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.

Sort of like XML - if you don't have CDATA that makes sense when you 
strip out all the <tags>, chances are you're using the wrong tool.

-- 
Darren New / San Diego, CA, USA (PST)
  Helpful housekeeping hints:
   Check your feather pillows for holes
    before putting them in the washing machine.



More information about the erlang-questions mailing list