Promote Regex.matchAt and matchesAt to Stable #KT-51470
This commit is contained in:
@@ -168,8 +168,8 @@ public actual class Regex internal constructor(internal val nativePattern: Patte
|
||||
/** Indicates whether the regular expression can find at least one match in the specified [input]. */
|
||||
actual fun containsMatchIn(input: CharSequence): Boolean = find(input) != null
|
||||
|
||||
@SinceKotlin("1.5")
|
||||
@ExperimentalStdlibApi
|
||||
@SinceKotlin("1.7")
|
||||
@WasExperimental(ExperimentalStdlibApi::class)
|
||||
public actual fun matchesAt(input: CharSequence, index: Int): Boolean =
|
||||
// TODO: expand and simplify
|
||||
matchAt(input, index) != null
|
||||
@@ -221,8 +221,8 @@ public actual class Regex internal constructor(internal val nativePattern: Patte
|
||||
*/
|
||||
actual fun matchEntire(input: CharSequence): MatchResult?= doMatch(input, Mode.MATCH)
|
||||
|
||||
@SinceKotlin("1.5")
|
||||
@ExperimentalStdlibApi
|
||||
@SinceKotlin("1.7")
|
||||
@WasExperimental(ExperimentalStdlibApi::class)
|
||||
public actual fun matchAt(input: CharSequence, index: Int): MatchResult? {
|
||||
if (index < 0 || index > input.length) {
|
||||
throw IndexOutOfBoundsException("index is out of bounds: $index, input length: ${input.length}")
|
||||
|
||||
Reference in New Issue
Block a user