From: "Peña, Botp" Date: 2008-06-24T17:22:58+09:00 Subject: Re: Regex extracting certain characters From: clement.ow@asia.bnpparibas.com # C:/Ruby/20080205/2008 # C:/Ruby/2008 # I need a regular expression which can select just 2008 and utilise the # string that contains just 2008 instead of 20080205. pardon if i'm mistaken, but maybe you may want to get the "ending" part of that pathname w/o using regex, eg, s #=> "C:/Ruby/20080205/2008" year=s.split("/").last #=> "2008" year == "2009" #=> false year == "2008" #=> true kind regards -botp