toRegex

inline fun String.toRegex(): Regex(source)

Converts the string into a regular expression Regex with the default options.

Since Kotlin

1.0

inline fun String.toRegex(option: RegexOption): Regex(source)

Converts the string into a regular expression Regex with the specified single option.

Since Kotlin

1.0

inline fun String.toRegex(options: Set<RegexOption>): Regex(source)

Converts the string into a regular expression Regex with the specified set of options.

Since Kotlin

1.0
inline fun Pattern.toRegex(): Regex(source)

Converts this java.util.regex.Pattern to an instance of Regex.

Provides the way to use Regex API on the instances of java.util.regex.Pattern.

Since Kotlin

1.0