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.
可能重复: 如何仅将有效的罗马数字与正则表达式匹配?
你好,
如何将正则表达式匹配到类似的东西
[i]) [ii]) [iii]) [iv])
等等...
谢谢
/^\[[ivmcldx]+\])/
应该抓住最常见的罗马数字。不过,它不会偶然发现无效数字iiix,例如 。
iiix