我想让所有字符串都放在第一个括号内
例如,如果输入:
“ 1 + 2 +(1 + 2 +(1 + 2))”
它将返回
[(1 + 2 +(1 + 2))]
如果输入:
“ 1 +(1 + 2 +(1 + 2 +(1 + 2)))”
它将返回
[“(1 + 2 +(1 + 2 +(1 + 2)))”]
答案 0 :(得分:-1)
您可以使用Pattern&Matcher类来提取所需内容,如下所示
Sub Sample()
Dim XL As New Excel.Application
Dim WBK As Excel.Workbook
For i = 1 To whatever
Set WBK = XL.Workbooks.Open(file)
'
'~~> Do Something
'
WBK.Close (False) 'or WBK.Close(True)
Set WBK = Nothing
Next i
XL.Quit
Set XL = Nothing
End Sub
输出
1 + 2 +(1 + 2 +(1 + 2))