Move toRegex extension in kotlin package
This commit is contained in:
@@ -16,3 +16,11 @@ public fun String.toRegex(option: RegexOption): Regex = Regex(this, option)
|
|||||||
* Converts the string into a regular expression [Regex] with the specified set of [options].
|
* Converts the string into a regular expression [Regex] with the specified set of [options].
|
||||||
*/
|
*/
|
||||||
public fun String.toRegex(options: Set<RegexOption>): Regex = Regex(this, options)
|
public fun String.toRegex(options: Set<RegexOption>): Regex = Regex(this, options)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Converts this [Pattern] to an instance of [Regex].
|
||||||
|
*
|
||||||
|
* Provides the way to use Regex API on the instances of [Pattern].
|
||||||
|
*/
|
||||||
|
@JvmVersion
|
||||||
|
public fun java.util.regex.Pattern.toRegex(): Regex = Regex(this)
|
||||||
@@ -211,6 +211,8 @@ public class Regex internal constructor(private val nativePattern: Pattern) {
|
|||||||
*
|
*
|
||||||
* Provides the way to use Regex API on the instances of [Pattern].
|
* Provides the way to use Regex API on the instances of [Pattern].
|
||||||
*/
|
*/
|
||||||
|
@Deprecated("Use extension toRegex instead in kotlin package.")
|
||||||
|
@HiddenDeclaration
|
||||||
public fun Pattern.toRegex(): Regex = Regex(this)
|
public fun Pattern.toRegex(): Regex = Regex(this)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user