Remember that if you want to add quantifiers (like "*" and "+"), you will have to group this:(?![;:])\W
(?:(![;:])\W)+
I haven't benchmarked it, but I expect the negative charclass as the other people have shown you, is likely faster.
In reply to Re: Exclude some non-word char from Regexp \W
by bart
in thread Exclude some non-word char from Regexp \W
by zangetsu
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |