> I think libc++ is correct. C++11 defines \W as being equivalent to > [^_[:alnum:]], which means your regex is "[^[^_[:alnum:]]]". I believe > that'll be parsed as "some weird character followed by ]]". Sorry, just one ] at the end since there is still a valid [:alnum:] in there. Tim.