Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
假设我想匹配“单词”字符 ( \w),但排除“_”,或者匹配空白字符 ( \s),但排除“\t”。我怎样才能做到这一点?
\w
\s
使用包含 \W 或 \S 的否定类。
/[^\W_]/ # anything that's not a non-word character and not _ /[^\S\t]/ # anything that's not a non-space character and not \t