[erlang-questions] Re: Adoption of perl/javascript-style regexp syntax

Robert Virding rvirding@REDACTED
Wed Jun 3 01:25:47 CEST 2009


2009/6/3 Ulf Wiger <ulf.wiger@REDACTED>

> Richard O'Keefe wrote:
>
>>
>> -1
>>
>> This is simply the wrong way to deal with complex regular expressions.
>> Introducing elaborate mechanisms to hide from the compiler what's
>> going on, in order to parse things at run time that could have been
>> done earlier?
>>
>> What's needed is a DOMAIN-SPECIFIC EMBEDDED LANGUAGE for regular
>> expressions, and all we need for that is lists, strings, constants,
>> and function calls.  By golly, we've GOT them!
>>
>
> While you've amply made your point that there are very
> good alternatives to regexps (which is something at least
> erlang old-timers have no problem accepting, since we've
> never had a really performant regexp library until quite
> recently),


I think what Richard is getting at here is not regular expressions as such
but representing them as strings. And then wishing to extend the string
syntax so as to  reduce the interaction between string \ and regexp \, which
makes the regexp even more difficult to read.

The alternative being to use normal erlang syntax to represent regexps
instead of strings. I personally like the idea. Look at how scsh does it.

Robert


More information about the erlang-questions mailing list