kotlin-stdlib / kotlin.text / toRegex toRegex Common JVM JS Native 1.0 fun String . toRegex ( ) : Regex (source) Converts the string into a regular expression Regex with the default options. Common JVM JS Native 1.0 fun String . toRegex ( option : RegexOption ) : Regex (source) Converts the string into a regular expression Regex with the specified single option . Common JVM JS Native 1.0 fun String . toRegex ( options : Set < RegexOption > ) : Regex (source) Converts the string into a regular expression Regex with the specified set of options .