klyn.MutableString.matches
method
public matches(regex as RegEx) as Boolean
Description

Tests the complete text against a regular expression.

Parameters
ParameterDescription
regexRegular expression; null does not match.
Returns

Whether the regular expression matches.

Throws
  • klyn.regex.RegExException for invalid regular-expression operations.
Example
import klyn.regex
assert m"123".matches(RegEx("[0-9]+"))