ruby - Parse many numbers containing commas from string -
Text after "div class =" itemprop = "text">
I have a series of wires that include all the following 1 or many numbers (in this case a number will be 123123123) format
"Some other numbers are 123,345,123" This is a number 123,124,123 ", 231,123,123, 124,152,123" "; 123,123,123; This is a strange situation 123,124,125 More text"
Is there a clear way to parse these numbers in an array or a string that I can split that looks like this? Finally, I was able to separate the numbers in such a way: <123> Want to be
<123> 123456 > "string" .scan (/ \ d /)
But obviously it is only giving me a comma without number and it is also not very different from the other.
do this way
string.scan (/ [\ d ,] + /)
Comments
Post a Comment