I have a string as follows:
--d--d-d---d--
I want to find all occurrences of 'd' in this string with their offsets.
However, doing the following only gives me back the first result:
irb(main):001:0> m = /d/.match "d--d-d---d"
=> #<MatchData "d">
irb(main):002:0> m.size
=> 1
What am I doing wrong? I thought match
will match all occurrences of the regex in the string.