I know that _ cannot be matched \W , while any other punctuation can. As stated in the docs: \W is a set of alphanumeric characters and underscores .
In the same time:

I was always embarrassed by this, but really did not wonder why.
Is this related to the special role _ plays in Python?
source share