\W
Matches any character which is not a word character. This is the opposite of \w. If the ASCII flag is used this becomes the equivalent of [^a-zA-Z0-9_]. If the LOCALE flag is used, matches characters which are neither alphanumeric in the current locale nor the underscore.
医生?https://docs.python.org/3/library/re.html
(简而言之:否,
\W
与_
不匹配)在regex中
\W
代表任何非单词字符。 其中非单词字符=anything other than letter, digit or underscore
。你知道吗从上面的语句中还应该清楚地看到,下划线被清楚地视为字母数字字符。你知道吗
相关问题 更多 >
编程相关推荐