提取括号内除分号之外的数据
想要提取括号内的数据。但是如果这些括号位于单引号之间。那么就应该忽略它。使用正则表达式。
输入:
XCA(AA+BB)AA(AD'A(CC)B')
预期输出:
AA+BB
AD'A(CC)B'
Want to extract data inside parenthesis. But if those parenthesis are inside between single quotes. Then it should be neglected. Using regular expression.
Input:
XCA(AA+BB)AA(AD'A(CC)B')
Expected Output:
AA+BB
AD'A(CC)B'
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
它由三个主要部分组成。
[^\(\)]+
任何不是括号的内容' \(
转义的左括号'(
\)'
转义的右括号)'
全部包含在匹配的括号文字中,然后是不重复的外部组(组 1)和具有重复的内部组。
第 1 组的比赛是
It consists of three main parts.
[^\(\)]+
Anything that is not an parenthesis' \(
an escaped open parenthesis'(
\)'
an escaped closing parenthesis)'
All enclosed in a matching parenthesis literals then an outer group (group 1) without repetition and an inner group with repetition.
The matches in group 1 are