Get rid of platform differences in Regex.find doc
This commit is contained in:
committed by
Space
parent
7fdd1154ee
commit
225be54c61
@@ -156,6 +156,7 @@ public actual class Regex internal constructor(internal val nativePattern: Patte
|
|||||||
* @param startIndex An index to start search with, by default 0. Must be not less than zero and not greater than `input.length()`
|
* @param startIndex An index to start search with, by default 0. Must be not less than zero and not greater than `input.length()`
|
||||||
* @return An instance of [MatchResult] if match was found or `null` otherwise.
|
* @return An instance of [MatchResult] if match was found or `null` otherwise.
|
||||||
* @throws IndexOutOfBoundsException if [startIndex] is less than zero or greater than the length of the [input] char sequence.
|
* @throws IndexOutOfBoundsException if [startIndex] is less than zero or greater than the length of the [input] char sequence.
|
||||||
|
* @sample samples.text.Regexps.find
|
||||||
*/
|
*/
|
||||||
@Suppress("ACTUAL_FUNCTION_WITH_DEFAULT_ARGUMENTS")
|
@Suppress("ACTUAL_FUNCTION_WITH_DEFAULT_ARGUMENTS")
|
||||||
actual fun find(input: CharSequence, startIndex: Int = 0): MatchResult? {
|
actual fun find(input: CharSequence, startIndex: Int = 0): MatchResult? {
|
||||||
|
|||||||
@@ -25,6 +25,7 @@ expect class Regex {
|
|||||||
*
|
*
|
||||||
* @param startIndex An index to start search with, by default 0. Must be not less than zero and not greater than `input.length()`
|
* @param startIndex An index to start search with, by default 0. Must be not less than zero and not greater than `input.length()`
|
||||||
* @return An instance of [MatchResult] if match was found or `null` otherwise.
|
* @return An instance of [MatchResult] if match was found or `null` otherwise.
|
||||||
|
* @throws IndexOutOfBoundsException if [startIndex] is less than zero or greater than the length of the [input] char sequence.
|
||||||
* @sample samples.text.Regexps.find
|
* @sample samples.text.Regexps.find
|
||||||
*/
|
*/
|
||||||
fun find(input: CharSequence, startIndex: Int = 0): MatchResult?
|
fun find(input: CharSequence, startIndex: Int = 0): MatchResult?
|
||||||
|
|||||||
@@ -66,11 +66,13 @@ public actual class Regex actual constructor(pattern: String, options: Set<Regex
|
|||||||
return nativePattern.test(input.toString())
|
return nativePattern.test(input.toString())
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Returns the first match of a regular expression in the [input], beginning at the specified [startIndex].
|
/**
|
||||||
|
* Returns the first match of a regular expression in the [input], beginning at the specified [startIndex].
|
||||||
*
|
*
|
||||||
* @param startIndex An index to start search with, by default 0. Must be not less than zero and not greater than `input.length()`
|
* @param startIndex An index to start search with, by default 0. Must be not less than zero and not greater than `input.length()`
|
||||||
* @return An instance of [MatchResult] if match was found or `null` otherwise.
|
* @return An instance of [MatchResult] if match was found or `null` otherwise.
|
||||||
* @throws IndexOutOfBoundsException if [startIndex] is less than zero or greater than the length of the [input] char sequence.
|
* @throws IndexOutOfBoundsException if [startIndex] is less than zero or greater than the length of the [input] char sequence.
|
||||||
|
* @sample samples.text.Regexps.find
|
||||||
*/
|
*/
|
||||||
@Suppress("ACTUAL_FUNCTION_WITH_DEFAULT_ARGUMENTS")
|
@Suppress("ACTUAL_FUNCTION_WITH_DEFAULT_ARGUMENTS")
|
||||||
public actual fun find(input: CharSequence, startIndex: Int = 0): MatchResult? {
|
public actual fun find(input: CharSequence, startIndex: Int = 0): MatchResult? {
|
||||||
|
|||||||
@@ -114,6 +114,8 @@ internal constructor(private val nativePattern: Pattern) : Serializable {
|
|||||||
*
|
*
|
||||||
* @param startIndex An index to start search with, by default 0. Must be not less than zero and not greater than `input.length()`
|
* @param startIndex An index to start search with, by default 0. Must be not less than zero and not greater than `input.length()`
|
||||||
* @return An instance of [MatchResult] if match was found or `null` otherwise.
|
* @return An instance of [MatchResult] if match was found or `null` otherwise.
|
||||||
|
* @throws IndexOutOfBoundsException if [startIndex] is less than zero or greater than the length of the [input] char sequence.
|
||||||
|
* @sample samples.text.Regexps.find
|
||||||
*/
|
*/
|
||||||
@Suppress("ACTUAL_FUNCTION_WITH_DEFAULT_ARGUMENTS")
|
@Suppress("ACTUAL_FUNCTION_WITH_DEFAULT_ARGUMENTS")
|
||||||
public actual fun find(input: CharSequence, startIndex: Int = 0): MatchResult? =
|
public actual fun find(input: CharSequence, startIndex: Int = 0): MatchResult? =
|
||||||
|
|||||||
Reference in New Issue
Block a user