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.
我目前正在使用
var rgx = new Regex("[^a-zA-Z0-9 -]");
我也想知道如何允许'。例如,它目前允许assassin但不允许assassin's
'
assassin
assassin's
我需要改变什么?
'需要先于-:
-
[^a-zA-Z0-9 '-]
否则,您刚刚在 (space) 和'