SYNTAX

<String>.matches(regularExpression:String)
<String>.matches(regularExpression:String,flags:<String>)

DESCRIPTION

Returns true if the regular expression matches the String.

FLAGS

The characters gis, when one or more are added to the expression with no separator, represent:

USAGE RESTRICTIONS

The Operators row of the table in Summary Table of Vocabulary Usage Restriction applies. No special exceptions.

This sample Rulesheet uses matches in non-conditional actions:
Action A: Determine whether a String is a valid identifier - A String must contain an item identification with the following pattern:
  1. Characters 1-5: alphabetic.
  2. Characters 6-10: numeric.
  3. Character 11: alphabetic.

Action B: Check whether an email address is valid - An email address must have alphanumeric characters and certain special characters before and after an @ and a dot.

SAMPLE RULETEST

A sample Ruletest provides various valid and invalid Strings that are evaluated by the two regular expression examples.