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.
正则表达式只有数字和连字符(-),加号(+)...连字符和加号是可选的。连字符应该是数字的中间。加号应该是开始。并且应该是 8-13 个字符
它应该接受以下内容
0484-760393
+917679888
5756765757
它不应该接受以下
-564654656
76+34543543
5252235(最少 8 个)
32525354567865(最大13)
请帮我
感谢您....
^[\+]?(\d\-?){8,12}\d$
我可以为你分解它,但听起来你不太关心实现,或者你会自己写=)