From 4a10d954fcd26c5f61da6364a6a279701b8db5a0 Mon Sep 17 00:00:00 2001 From: Ilya Gorbunov Date: Fri, 19 Oct 2018 00:08:45 +0300 Subject: [PATCH] Unify and improve Regex docs --- libraries/stdlib/js/src/kotlin/regex.kt | 42 ++++++++++++++----- .../stdlib/jvm/src/kotlin/text/regex/Regex.kt | 27 +++++++++--- 2 files changed, 53 insertions(+), 16 deletions(-) diff --git a/libraries/stdlib/js/src/kotlin/regex.kt b/libraries/stdlib/js/src/kotlin/regex.kt index 9a6f372c1f9..66156deec41 100644 --- a/libraries/stdlib/js/src/kotlin/regex.kt +++ b/libraries/stdlib/js/src/kotlin/regex.kt @@ -28,9 +28,15 @@ public actual enum class RegexOption(val value: String) { */ public actual data class MatchGroup(actual val value: String) -/** A compiled representation of a regular expression. + +/** + * Represents a compiled regular expression. + * Provides functions to match strings in text with a pattern, replace the found occurrences and split text around matches. * - * For pattern syntax reference see [https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp] and [http://www.w3schools.com/jsref/jsref_obj_regexp.asp] + * For pattern syntax reference see [MDN RegExp](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp#Special_characters_meaning_in_regular_expressions) + * and [http://www.w3schools.com/jsref/jsref_obj_regexp.asp](https://www.w3schools.com/jsref/jsref_obj_regexp.asp). + * + * @constructor Creates a regular expression from the specified [pattern] string and the specified set of [options]. */ public actual class Regex actual constructor(pattern: String, options: Set) { @@ -89,7 +95,7 @@ public actual class Regex actual constructor(pattern: String, options: Set { @@ -150,17 +157,32 @@ public actual class Regex actual constructor(pattern: String, options: Set