【发布时间】:2016-03-19 10:24:15
【问题描述】:
周六快乐,
我想知道 Stackoverflow 的用户是否可以给我一个关于特定正则表达式的线索..
(^visite\d+)(?!\D)
上面的正则表达式运行良好..
上面写着:
visite12345 --> is a good anwser (the string does match)
visite1a --> is not a good anwser (the string doesn't match)
但是对于:
visite12345a --> It doesn't work.
确实,输出是 visite1234,而我想得到与 visite1a 相同的答案(字符串不匹配)...
我使用http://regexr.com/ 来测试我的正则表达式。
你知道怎么做吗? 非常感谢。
【问题讨论】:
-
它也会在您的第一个输入中捕获
visite1234。你想做什么?
标签: javascript regex string regex-lookarounds