I have a question about regular expressions in vba. I looked it up on vba and found that it doesn't read afterwards.
[~~~]
Could you tell me how to avoid reading after matching only the characters in parentheses?
SubMatches
can be taken out by grouping using parentheses such as (.*?)
.
Sub button 1_Click()
Dimre As RegExp
Set = New RegExp
re.Pattern="[(.*?)]"
Set matches=re.Execute("hoge[fuga]piyo")
MsgBox matches.Item(0).SubMatches(0)'"fuga" appears.
End Sub
References
Use regular expressions in VBA (RegExp object method)
351 Environment dependent characters? are displayed.
359 Understanding How to Configure Google API Key
354 AttributeError at /admin/r/31/4/ 'NoneType' object has no attribute 'startswith'
369 FileNotFoundError in json: What is the difference between these two?
356 In C/C++, if only variable definitions are used, is it Nil?
© 2023 OneMinuteCode. All rights reserved.