ruby - How do I use a regular expression to match a number as an integer? -


when match number using regular expression string:

?> 'testingsubject2981'.match /\d+$/ => #<matchdata "2981"> 

is somehow possible number integer without to_is?

the issue regular expressions work on strings, not on other data types.

a regex has patterns match numbers, still find characters represent number, not binary values we'd use math. once engine returns matches, they're still characters, have use to_i convert them binary representations.

mmm-kay?


Comments

Popular posts from this blog

linux - Does gcc have any options to add version info in ELF binary file? -

android - send complex objects as post php java -

charts - What graph/dashboard product is facebook using in Dashboard: PUE & WUE -