in reply to Exclude some non-word char from Regexp \W
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.
|
|---|