diff --git a/libraries/stdlib/jdk8/src/kotlin/text/RegexExtensions.kt b/libraries/stdlib/jdk8/src/kotlin/text/RegexExtensions.kt index 133bbf7e08c..62c51fd875a 100644 --- a/libraries/stdlib/jdk8/src/kotlin/text/RegexExtensions.kt +++ b/libraries/stdlib/jdk8/src/kotlin/text/RegexExtensions.kt @@ -23,7 +23,8 @@ package kotlin.text * 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 [UnsupportedOperationException] if getting named groups isn't supported on the current platform. + * @throws IllegalArgumentException if there is no group with the specified [name] defined in the regex pattern. + * @throws UnsupportedOperationException if getting named groups isn't supported on the current platform. */ @SinceKotlin("1.2") public operator fun MatchGroupCollection.get(name: String): MatchGroup? { diff --git a/libraries/stdlib/src/kotlin/text/regex/MatchResult.kt b/libraries/stdlib/src/kotlin/text/regex/MatchResult.kt index 2ff24dbed2a..c0e11f0b7c9 100644 --- a/libraries/stdlib/src/kotlin/text/regex/MatchResult.kt +++ b/libraries/stdlib/src/kotlin/text/regex/MatchResult.kt @@ -35,6 +35,8 @@ public interface MatchNamedGroupCollection : MatchGroupCollection { /** * 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 getting named groups isn't supported on the current platform. */ public operator fun get(name: String): MatchGroup? }