regexp bug (literal dot)

Chris Pressey cpressey@REDACTED
Tue Mar 26 00:31:44 CET 2002


On Mon, 25 Mar 2002 23:57:28 +0100
Willem Broekema <willem@REDACTED> wrote:

> Hi all,
> 
>  From what I understand, in regexps, "." means 'any char' and "\." means
>  a literal dot.
> 
> So, the following is a bug:
> 
> 170> regexp:match("a", ".").
> {match,1,1}
> 
> 171> regexp:match("a", "\.").
> {match,1,1}  % shouldn't match!
> 
> 
> - Willem

Erlang strings are quoted as well as regexps, so you probably want

  regexp:match("a", "\\.").

Chris



More information about the erlang-questions mailing list