I'd like to match a regex and get the position in the string of the match
For example,
"AustinTexasDallasTexas".match_with_posn /(Texas)/
I'd like match_with_posn
to return something like: [6, 17]
where 6 and 17 are the start positions for both instances of the word Texas.
Is there anything like this?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…