Use JS substituteGroupRefs implementation in Native as well

This commit is contained in:
Abduqodiri Qurbonzoda
2021-09-30 17:46:49 +03:00
committed by Space
parent dc2f5eab25
commit 1ae7c2af21
2 changed files with 58 additions and 34 deletions
@@ -359,6 +359,7 @@ private fun RegExp.findNext(input: String, from: Int, nextPattern: RegExp): Matc
}
}
// The same code from K/N Regex.kt
private fun substituteGroupRefs(match: MatchResult, replacement: String): String {
var index = 0
val result = StringBuilder(replacement.length)