kotlin-stdlib / kotlin.text / toPattern toPattern JVM 1.0 fun String.toPattern(flags: Int = 0): Pattern Converts the string into a regular expression Pattern optionally with the specified flags from Pattern or'd together so that strings can be split or matched on.