matches

infix fun String?.matches(regex: String): Boolean(source)

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.*")