pla*_*etp 32 regex perl character-class
假设我想匹配"单词"字符(\w),但排除"_",或匹配空白字符(\s),但排除"\ t".我怎样才能做到这一点?
yst*_*sth 46
使用包含\ 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
Run Code Online (Sandbox Code Playgroud)