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.
我需要一个正则表达式来匹配一个必须包含两个正整数的字符串,这些正整数由一个反分线分隔。
例子:
12345_678 好 12345-678 坏 12345_678a 坏
谢谢
^[0-9]+_[0-9]+$会做的。
^[0-9]+_[0-9]+$
解释
^
[0-9]+
_
$