我需要的'('和')'字符的所有字符。
I need to get all characters between '(' and ')' chars.
var str = "dfgdgdfg (aaa.bbb) sfd (c) fdsdfg ( ,ddd (eee) )";
在这个例子中,我需要3字符串:
In this example, I need to get 3 strings:
(aaa.bbb)
(c)
( ,ddd (eee) )
我有什么模式来写?请帮助。
What pattern I have to write? Please, help.
尝试是这样的:
\(([^)] +)\)
编辑:其实这样做的非常的最后一些工作 - 这EX pression没有捕捉到最后一个子正常。我已经CW'd这个答案,这样的人有更多的时间可以人肉出来,使其正常工作。
Actually this does quite work for the last bit - this expression doesn't capture the last substring properly. I have CW'd this answer so that someone with more time can flesh it out to make it work properly.