Error prone behavior of regexp. / Emacs mode.

Robert Virding robert.virding@REDACTED
Fri Apr 4 16:26:47 CEST 2003


This is a bug of course. It is easy to fix but unfortunately there is no
really backwards compatible way of fixing it. If someone has saved an old
parsed regexp it will not work with the fix. Is this ok Kenneth?

I have a new regexp with some new useful features so I will fix this and the
null match bug others have found and release it.

Robert

----- Original Message -----
From: "Pierpaolo BERNARDI" <bernardp@REDACTED>
To: <erlang-questions@REDACTED>
Sent: Sunday, March 30, 2003 8:23 AM
Subject: Error prone behavior of regexp. / Emacs mode.


> Several functions in regexp behave like this:
>
> 22> regexp:match("foo",xxx).
> nomatch
>
> That is, if the r.e. is not a list, it is assumed to be an already
> parsed r.e. with no safety check whatsoever.
>
> I tripped in this doing by mistake:
>
> RE = regexp:parse([$t,$r,$e,$$]),
> lists:map(fun(P)-> ...
>                    {ok,S3,_} = regexp:sub(P,RE,"tré"),
>
> Surely my fault, but the module could easily be more helpful.
>
> -----
>
> On another topic, the emacs mode misparses strings ending in $.
> In "foo$",  $" is parsed as a character, compromising
> the indentation of the rest of the file.   Before I start digging in the
> emacs mode, maybe someone has already fixed this?
>
> P.
>
>




More information about the erlang-questions mailing list