test

Returns true if the value matches the regular expression and false otherwise.
Accepts
Returns
Syntax
test(text, pattern) text.test(pattern)

At its simplest, test works in the same way as contains, returning true if the search string is found in the value. It is also case-sensitive.

test(
    "bensomething", 
    "ben"
)
=
true

What makes test much more powerful is the ability to use regular expressions in the search.