couchdb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dirkjan Ochtman <>
Subject Re: couch_config_writer.erl: meaning of single backslash in regular expression
Date Fri, 08 Apr 2011 11:20:43 GMT
On Fri, Apr 8, 2011 at 13:16, Andrey Somov <> 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.



View raw message