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.
我有这个正则表达式
(\((-?\d+.\d+\s?-?\d+.\d+,?)+\))*
这似乎与字符串开头的字符之间的空格以及我想要匹配的部分相匹配。如何将我的正则表达式更改为不匹配这些,因为它在转换为 JSON 时会导致空数组?
使用+(一个或多个)代替*(零个或多个)
+
*
(\((-?\d+.\d+\s?-?\d+.\d+,?)+\))+