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.
我试图找出“XX”的正则表达式,其中“X”是数字。
一些有效值:
1.1
2.0
0.1
9.1
9.9
一些无效值:
10.1
9.22
1
10
查看您的示例,此正则表达式应该可以工作:
/^\d\.\d$/
我不是正则表达式专家,但是当我在 Rubular 上测试一条只有 XX 的行时,“^\d.\d$”似乎对我有用。