Closed indiejames closed 9 years ago
Thanks :)
So it's matching the second abc, but not the first. Hm. Regex.run
doesn't tell us the index of the match, the client just looks for the first instance of the match in the string.
Perhaps there's another function we can use to get the index, otherwise this is going to be a tricky to fix.
Regex.run ~r/abc(?!.*abc)/, "abcghjkabchj", return: :index
# [{7, 3}]
There we go :)
Nice, thanks. I didn't now about return: :index.
Me either ;)