From: "Derrick B." Date: 2013-05-24T02:33:15+09:00 Subject: Re: Regular expression to find a break in a pattern regex capturing with assignment. Capture your string or number in the From field using parenthesis to capture and assign: /(\d+)/ ...then compare the assigned value, which is $1, with the next string Sorry to do this to your all, but this is a quick Perl example I just whipped up, but is easy to convert to Ruby: perl -le '$x = "12345"; $y = "123465"; if ( $x =~ /(\d+)/ ) { if ( $y == $1 ) { print "yep" } else { print "nope!" } } ' -- Posted via http://www.ruby-forum.com/.