klyn.String.matches
method
public matches(regex as klyn.regex.RegEx) as Boolean throws klyn.regex.RegExException:
Description

Tests the string against a regular expression.

Parameters
ParameterDescription
regexRegular expression.
Returns

True if the regex matches.

Throws
  • RegExException if the regular expression cannot be evaluated.
Example
import klyn.regex

assert "12345".matches(RegEx(r"^\d+$"))