VBScript のプロパティ、Pattern プロパティ x|y
Set r = New RegExp str = "abc" r.Pattern = "a|bbc" Set Matches = r.Execute(str) MsgBox Matches(0) ' a r.Pattern = "(a|b)bc" Set Matches = r.Execute(str) MsgBox Matches(0) ' abc r.Pattern = "(abc|b)" Set Matches = r.Execute(str) MsgBox Matches(0) ' abc