[erlang-questions] unexpected matching in re 12B5

Michael McDaniel erlangy@REDACTED
Tue Feb 17 20:19:52 CET 2009



On Tue, Feb 17, 2009 at 08:11:43PM +0100, Attila Babo wrote:
> 1> re:run("a b", "\\w\s\\w").
> {match,[{0,3}]}
> 
> While fixing a typo in my code I've found that \s with a single
> backslash is matching with a space in re:run but not the other general
> characters. Is this is bug or feature of re? :-)
> 
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

 From the re module docs at http://erlang.org/doc/man/re.html

"
Generic character types

  ...

\s
    any whitespace character 

  ...
"


~M


> /Attila
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://www.erlang.org/mailman/listinfo/erlang-questions



-- 
Michael McDaniel
Portland, Oregon, USA
http://autosys.us
http://mmcdaniel.com/erlview




More information about the erlang-questions mailing list