toPattern

inline fun String.toPattern(flags: Int = 0): Pattern(source)

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.

Since Kotlin

1.0