Text.match
matchpatterncase_sensitivity
Group: Text
Aliases: check matches
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 matchself
against.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,
find
throws anIllegal_Argument
error. - If a non-default locale is used,
find
throws anIllegal_Argument
error.