Reputation: 4923
We have a string: "<b><c><d><e>"
<b><c><d><e>
And this Regexp: /<(\w+)>/i
/<(\w+)>/i
How can I get ALL of the matches from current string?
Upvotes: 5
Views: 2197
Reputation: 23194
"<b><c><d><e>".scan(/<(\w+)>/)
See scan on ruby-docs
Upvotes: 10