From: "trans. (T. Onoma)" Date: 2004-10-22T22:03:56+09:00 Subject: Re: A little help on finding the closest match On Friday 22 October 2004 04:19 am, Robert Klemme wrote: | If you're just interested in the tokens you probably want this: | | /(token1)|(token2(?:sub2))/ | | i.e. use capturing groups for tokens and non capturing groups for all sub | groups. Indeed! Thank You. I was doing this: /(sub)(token)(?=sub)/ But looking over my code I think your expression may work better. I will try and see. | > And the match indexes seem to get lost when I join them. Also, I'm not | > sure how to tell which token it was that actually matched. | | You can use Regexp#match. Or use scan in a method with return in the | block. Okay, I'll look into this too. Thanks again, T. (God willing, I may actually finish this program in my lifetime ;)