[erlang-questions] some language changes

Torbjorn Tornkvist <>
Wed May 23 10:33:29 CEST 2007


Darius Bacon wrote:
> ok <> wrote:
>> So here's how I would like to write that:
>>
>>      X = seq(any(".?!"), span("\"')]}"),
>>               alt("\n", "\t", seq(" ",any(" \t\n"))),
>>               span(" \t\n"))
> 
> I would, too -- the regexp code I posted the other day exported
> constructor functions along these lines (even named seq and alt), with
> the regexp syntax exiled to a separate parser module. It'd be nice if
> the standard regexp module did this.
> 
> Darius

Very nice!
However, it would be even nicer with some included examples on how to
run the code... :-)

Let's say I have the following regexp:

 "^now/(plus|minus)(\d{1,2})hours/$"

then:

 In: "now/plus42hours/"
 Out: ["plus, "42"]        (or something like that)

 In: "now/plus100hours/"
 Out: nomatch

Can I do it with 'ergex' ?
Can I do it with any other of the various regexp modules that are
floating around ?

Cheers, Tobbe




More information about the erlang-questions mailing list