The matches() function tests whether a supplied string matches a regular expression. For example, «matches("PGW867", "[A-Z]{3}[0-9]{3}") » returns true .
Argument | Data Type | Meaning |
---|---|---|
input | xs : string? | The string to be tested against the regular expression. If an empty sequence is supplied, an empty sequence is returned |
regex | xs:string | The regular expression |
flags (optional) | xs:string | One or more letters indicating options on how the matching is to be performed. If this argument is omitted, the effect is the same as supplying a zero-length string, which defaults all the option settings. The flags are the same as for the <xsl:analyze-string> instruction described on page 176 |
Result | xs:boolean? | true if the input string matches the regular expression, false if not |