正则表达式识别字母数字的问题
我正在尝试构建一个过滤字母数字字符串的正则表达式。这意味着类似“12ab”或“ab12”或“a12b”。我不能与单个字符或数字匹配。我的尝试是“[0-9a-zA-Z]+”。但这没有用。对我来说,说“字符串以字符或数字开头......”是一个问题,
这里有一些例子。
被认可: “aab2”“23ab”“a1”“a2acd”
不被识别: “a”“aads”“1”“232323”“。” “+”“sas+”
问候, 哈尼球
I am trying to build a regex which filters alphanumerical strings. That means something like "12ab" or "ab12" or "a12b". I must not match with single chars or numbers. My attempt was '[0-9a-zA-Z]+'. But this didn t work. For me it is a problem to say "the string starts with a character or a number ..."
Here some examples.
to be recognized:
"aab2" "23ab" "a1" "a2acd"
not to be recognized:
"a" "aads" "1" "232323" "." "+" "sas+"
Greetings,
Haniball
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)