Reputation: 3338
I have this string:
str = "\r\n <span>60 %</span>\r\n <br>\r\n40 %"
And I want to extract the 2 percentage, so I wrote this:
str.match(/(\d{1,2}\s%)/)
but it only returns the first one and can't understand why:
=> #<MatchData "60 %" 1:"60 %">
If I try this in rubular it works.
Upvotes: 0
Views: 105