testx
To check if a text has matches with a given regular expression
This function does the same as
contains()
: it checks a text for the occurrence of a certain string. But doing this, it uses regular expressions. You, therefore, have much more possibilities to analyze your given texts.Using regular expressions might need some extra research. We recommend checking regular expressions on https://regex101.com/ (external link).
testx(string, string)
testx(string, string, string)
boolean
testx(myText, regex)
To return Yes (true
) if a given text matches a given regular expression.1
testx("Hello [username]! You have [number of messages] messages!", "\[(\w|\s)*\]")
Result: Yes (
true
) (with the regular expression matching any combination of normal characters and white spaces between square brackets)
testx(myText, regex, flags)
To return Yes (true
) if a given text matches a given regular expression. Flags can be added to the regular expression.
replacex
, which replaces the matches of a given regular expression with a given string in a given textLast modified 7mo ago