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.
如果你有一个像test\(\d+,[a-z]+\). 它与一些字符串匹配,你如何提取匹配的字符串\d+and [a-z]+。
test\(\d+,[a-z]+\)
\d+
[a-z]+
注意:以上是一个简单的例子,解决方案应该适用于任何情况。
添加捕获组:
test\((\d+),([a-z]+)\)