I\'d like to match a regex and get the position in the string of the match
For example,
\"AustinTexasDallasTexas\".match_with_posn /(Texas)/ <
\"AustinTexasDallasTexas\".match_with_posn /(Texas)/
Sort of, see String#index
"AustinTexasDallasTexas".index /Texas/ => 6
Now, you could extend the String API.
class String def indices e start, result = -1, [] result << start while start = (self.index e, start + 1) result end end p "AustinTexasDallasTexas".indices /Texas/ => [6, 17]