Skip to content

matches

infix fun String?.matches(@Language



(value = "RegExp") regex: String): Boolean

Verifies that the current string matches the specified regex.

Returns true if the receiver is non-null and matches the given regex. Returns false otherwise.

Example

check("Bob Lizard" matches ".*L.*")