I\'m using this code:
s = line.match( /ABCD(\\d{4})/ ).values_at( 1 )[0]
To extract numbers from strings like:
ABCD1234 AB
To extract number part from a string use the following:
str = 'abcd1234' /\d+/.match(str).try(:[], 0)
It should return 1234
1234