From: lasitha Date: 2009-02-21T05:23:48+09:00 Subject: Re: String#include? with several possibilities? On Sat, Feb 21, 2009 at 1:04 AM, Aldric Giacomoni > lasitha wrote: >> $: irb >> 01> s = "The quick brown fox jumps over the lazy dog" >> --> "The quick brown fox jumps over the lazy dog" >> 02> s =~ /(quick|brown|fox)/ >> --> 4 >> 03> s =~ /(not|this|nor|that)/ >> --> nil > > Oh.. Duh! Must learn to thing with regexp. Thank you! What does the number > mean? It was a mindshift for me too, no doubt. If i give you a couple more samples i'm sure you'll figure out what the number stands for :) $: irb 01> s = "The quick brown fox jumps over the lazy dog" --> "The quick brown fox jumps over the lazy dog" 02> s =~ /quick|brown|fox/ --> 4 03> s =~ /brown|fox/ --> 10 04> s =~ /fox/ --> 16 By the way, the parentheses surrounding the union in my previous post were superfluous. Cheers, lasitha.