KT-51908 Common MatchGroupCollection.get(name) extension function
This commit is contained in:
committed by
Space Team
parent
448e9fc5e7
commit
175566fe56
@@ -25,3 +25,14 @@ public inline fun String.toRegex(option: RegexOption): Regex = Regex(this, optio
|
||||
*/
|
||||
@kotlin.internal.InlineOnly
|
||||
public inline fun String.toRegex(options: Set<RegexOption>): Regex = Regex(this, options)
|
||||
|
||||
/**
|
||||
* Returns a named group with the specified [name].
|
||||
*
|
||||
* @return An instance of [MatchGroup] if the group with the specified [name] was matched or `null` otherwise.
|
||||
* @throws IllegalArgumentException if there is no group with the specified [name] defined in the regex pattern.
|
||||
* @throws UnsupportedOperationException if this match group collection doesn't support getting match groups by name,
|
||||
* for example, when it's not supported by the current platform.
|
||||
*/
|
||||
@SinceKotlin("1.9")
|
||||
public expect operator fun MatchGroupCollection.get(name: String): MatchGroup?
|
||||
Reference in New Issue
Block a user