From: "S.Z." Date: 2005-11-26T22:07:28+09:00 Subject: What branch of (|) RE is match? I have a fragment like this: variant= [ /[abc]/, /[123]/, /[xyz]/ ]; re= /aaa\s(#{variant.join('|')})\sbbb/; mch= re.match($stdin.read); (Remove the semicolons if you hate them.) Now, I need to know what branch of variant is match, /[abc]/ or /[123]/ or /[xyz]/ How can I reveal it? variant can be iterated with mch[1] : vm= variant.find { |v| v.match(mch[1]); } But it is superfluous work, isn't it?