Text.match
matchpatterncase_sensitivity
Group: Text
Aliases: check matches, like, regex
Documentation
Checks if the whole text in self matches a provided pattern. For details on Enso's Regex syntax, see the Help Documentation.
Arguments
pattern: The pattern to matchselfagainst.case_sensitivity: Specifies if the text values should be compared case sensitively.
Examples
Checks if whole text matches a basic email regex.
example_match =
regex = ".+ct@.+"
# Evaluates to true
"contact@enso.org".match regex
example_match_insensitive =
regex = ".+ct@.+"
# Evaluates to true
"CONTACT@enso.org".match regex Case_Sensitivity.Insensitive
Errors
- If an empty regex is used,
findthrows anIllegal_Argumenterror. - If a non-default locale is used,
findthrows anIllegal_Argumenterror.