guys, I need some regex function which is similar ...
# announcements
e
guys, I need some regex function which is similar to
regex.find(text, startIndex)
from std lib I need something like
regex.find_at_position_or_fail(text, startIndex)
For example:
Copy code
val text = "text 22 and more text"
val reg = Regex("[0-9]+")
val res1 = reg.find(text, startIndex = 1) // it's find match '22' at position = 5. But this is not I want
val res2 = reg.find_at_position_or_fail(text, startIndex = 1) // should return null, because there is no match at position 1
val res3 = reg.find_at_position_or_fail(text, startIndex = 5) // should find match, because it's certainly at position 5
Help me, guys