From: Patrick Hurley Date: 2006-10-28T00:44:11+09:00 Subject: Re: a regex On 10/27/06, Alexandru Popescu wrote: > Hi! > > I have a string in the following form: 2006%2F10%2Fasdfasdf (or more > generic: any_characters+%2Fany_characters+%2Frest_of_it). I am > wondering if I can retrieve the groups 2006, 10, asdfasdf thru a regex > (I confess I couldn't figure it out so far :-( ). > > many thanks, > > ./alex > -- > .w( the_mindstorm )p. > > I am pretty sure I am missing something from your requirements... "some character%2Fmore stuff%2Fthe rest...".match(/^(.*?)%2F(.*?)%2F(.*)$/) puts $1 puts $2 puts $3 pth