开发者

Regex Eliminate Vertical Bar/ Pipe Character

Using the follo开发者_如何转开发wing regex with the ExtJS library, the intention is to only allow spaces, dollar signs, underscores, alpha and numeric characters. However, for some reason, the vertical bar/ pipe character is allowed as well. I hope someone can tell me what I am missing here. Am I inadvertently escaping one of the vertical bars?

maskRe:/^[a-z|A-Z|0-9|$|_ ]$/

Thank you kindly for your time!


You don't need the vertical bars inside your character class. Try the following instead:

maskRe:/^[a-zA-Z0-9$_ ]$/
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜