From: Sam Morrison Date: 2007-07-27T22:02:56+09:00 Subject: Re: Regexp's comparison ------=_Part_5548_33092964.1185541379215 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline On 7/27/07, Marcin Tyman wrote: > > Hi guys, > > I have string i.e: > a > b > c > c > c > a > c > d > > For example I would like to match all c lines with regexp. How can I > create the regexp if c lines can be ordered differently i.e: > a > c > b > c > c > a > d Do you want to find out how many lines have c? Or find out witch line numbers c is on? Or do you have one string "acbccad" or "ascffbdrc" and you are trying to find out if c is in that line? If that is what you are trying to do then try this: "acbccad".scan(/c/) can you tell us more about what you are looking for? Sorry if this hasn't helped. -- sam ------=_Part_5548_33092964.1185541379215--