寻找匹配括号之间文本的模式。例如:"(this is) a (test)"
应该输出
"this is"
"test"
使用Dim m As Match = Regex.Match(str, pattern, RegexOptions.Multiline)
我已经搜索了 stackOverflow、Google 并尝试了 RegExr 上的示例,但似乎没有什么对我有用。
这些适用于 RegExr 但不适用于 VB.NET
"\(([^)(]++|(?R))+\)"
- 错误嵌套量词
"(?<=\<p\>)(.*?)(?=<\/p\>)"
- 量词什么都没有
其他人将返回:
"this is) a (test"
- 匹配远外括号
PS我也可以这样做
[],"",{}
对于在 vb.net 下查看的任何人来说,将它们全部放在一个地方会很好