我在编写一个从字符串中去除外括号的正则表达式时遇到了一些麻烦(我想确保保留单引号/双引号内的任何括号):
((0)) becomes 0
(0) becomes 0
('(0845) 187 1262') becomes '(0845) 187 1262'
我有两个正则表达式来匹配左右外括号:
^[\(]* -- matches out the left outer brackets
[\)]*$ -- matches out the right outer brackets
是否可以将两者组合成一个正则表达式?