R
Raimon Fs
Hello,
I'm playing for my very first time with Regex ...
I want to split some numbers, and get their results:
Given this string:
18,04 2,89 20,93 2,71 18,22
I want to get every number before a comma, and two digits later, and all
the groups.
I think it should work this way but I can only get the first result ...
/(\d+,\d{2})/ =~ "18,04 2,89 20,93 2,71 18,22"
=> 0=> nil
Playing with the http://www.rubular.com/ I can get the result that I
want ...
I also tried the Regexp.last_match but I'm getting the same, only the
first value ...
what I'm doing wrong ?
thanks!
r.
I'm playing for my very first time with Regex ...
I want to split some numbers, and get their results:
Given this string:
18,04 2,89 20,93 2,71 18,22
I want to get every number before a comma, and two digits later, and all
the groups.
I think it should work this way but I can only get the first result ...
/(\d+,\d{2})/ =~ "18,04 2,89 20,93 2,71 18,22"
=> 0=> nil
Playing with the http://www.rubular.com/ I can get the result that I
want ...
I also tried the Regexp.last_match but I'm getting the same, only the
first value ...
what I'm doing wrong ?
thanks!
r.