[erlang-questions] some language changes

Darius Bacon darius@REDACTED
Thu May 24 01:00:53 CEST 2007

Torbjorn Tornkvist <tobbe@REDACTED> wrote:
> 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' ?

No, that doesn't record submatches -- it was just an evening hack to
tackle a fun problem from Luke. Expanding it into a supported library
would be a waste of effort. However, I've read regexp.erl now and
could write some patches for it, if they're wanted. (I'm hesitating
because they would change the result of the parse function into a
different representation of the same regular expression -- is keeping
this undocumented-but-exposed data structure the same more important
than fixing matching to always terminate? Of course you could keep it
unchanged but run a prepass just before matching -- yucko.)

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

The gregexp module in jungerl looks like it's the stdlib regexp plus


More information about the erlang-questions mailing list