Regex.test

Regex.test

Regex.test

Function

Determine whether the text matches the current regular expression.

Syntax

Parameters

ParametersTypeRequiredDefault valueDescription
textAnyNo''The text to be tested will be converted into a string first when called.

Return value

TypeDescription
BoolReturns true if the match is successful, otherwise returns false.

Example

Notes

  • Regular objects are created by the system function regex(pattern, flags).