Alexandru Popescu wrote: > Thanks for all suggestions, but the requirement is to be done thru > regex only :-). I knew how to do it with split, but I need to do it > with regexps only. How about just: irb(main):001:0> match = '2006%2F10%2Fasdfasdf'.match /^(.*)%2F(.*)%2F(.*)$/ => #<MatchData:0x1cf404> irb(main):002:0> match[1] => "2006" irb(main):003:0> match[2] => "10" irb(main):004:0> match[3] => "asdfasdf" -- Posted via http://www.ruby-forum.com/.