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.
我无法实现并找到一个正则表达式来检测重复数字(超过 2 次)的序列,例如:
1111 or a1111 or test4555
有人可以帮助我吗?
你可以写:
/(\d)\1\1/
where\d表示“一个数字”,(...)表示“捕获(记住)...匹配的内容”,并\1表示“第一个(...)捕获的内容”。
\d
(...)
...
\1