couchdb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrey Somov <trophyb...@googlemail.com>
Subject Re: couch_config_writer.erl: meaning of single backslash in regular expression
Date Fri, 08 Apr 2011 16:52:08 GMT
I was asking the question because I was not sure whether the Erlang's
dialect has a special meaning for "escaped" underscore.
I am afraid it is just a minor bug.
Shall I create an issue ?

-
Andrey

On Fri, Apr 8, 2011 at 1:20 PM, Dirkjan Ochtman <dirkjan@ochtman.nl> wrote:

> On Fri, Apr 8, 2011 at 13:16, Andrey Somov <trophybase@googlemail.com>
> wrote:
> > {ok, Pattern} = re:compile(["^(", Key, "\\s*=)|\\[[a-zA-Z0-9\_-]*\\]"]),
> >
> > What does the single backslash mean (\_)? When I remove it the tests
> still
> > succeed. (to be precise they fail in the same way as with the single
> > backslash)
>
> I'm guessing it's supposed to be an escape character, but I don't know
> of any regex dialect where the underscore is meaningful inside a
> character range.
>
> Cheers,
>
> Dirkjan
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message