28,390
社区成员
发帖
与我相关
我的任务
分享
str="[s1]KX-01[/s1][s1]KX-02[/s1]"
str1=""
Set regEx = New RegExp
regEx.Pattern = "(\[s1\])?(\S+)(\[\/s1\]\1)"
regEx.IgnoreCase = True
regEx.Global = True
Set Matches = regEx.Execute(str)
For Each Match in Matches
str1=str1&"(product:S1)"&Match.SubMatches(1)
Next
MsgBox str1