17/05/24 14:38:10.49 ktSIKEk8H.net
>>211
正規表現(RegExp)を使うと、指定したパターンに適合する文字列を抜き出せる。
以下は、"発売金額 \1,000"という文字列から"1,000"を抜き出すコード。
Sub foo()
Set regex = CreateObject("VBScript.RegExp")
regex.Pattern = "発売金額 \\([\d,]+)"
Set res = regex.Execute("aaa発売金額 \1,000 bbb")
If res.Count > 0 Then
Set res2 = res(0).SubMatches
Debug.Print res2(0)
End If
End Sub