开发者

Regex Eliminate Vertical Bar/ Pipe Character

开发者 https://www.devze.com 2023-01-14 12:18 出处:网络
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 vertica

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

精彩评论

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