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.
我将如何编写正则表达式来验证特定格式
假设我有版本号
v1.0 or v2.0
等,我的正则表达式只检查或的存在v或number,.我如何在javascript中对特定格式进行验证
v
number
.
你可以试试这个正则表达式:
/^v\d+(\.\d+)+$/i
这将匹配:
等等