I\'m using this code:
s = line.match( /ABCD(\\d{4})/ ).values_at( 1 )[0]
To extract numbers from strings like:
ABCD1234 AB
a.map {|x| x[/\d+/]}