[]
This function helps to find whether the text matches a regular expression.
SJS.REGEXMATCH(text, regular_expression, [modifiers])
This function has the following arguments:
Argument | Description |
---|---|
text | Refers to the text you are trying to test against the regular_expression. |
regular_expression | Refers to a regular expression to test the text against. |
modifiers | [Optional] Input to define the pattern.
|
You can use this function with text (not numbers) as input and return a logical value, i.e., TRUE or FALSE as output.
If you want to use a number as input, convert them to text using the TEXT function.
SJS.REGEXMATCH("SpreadJS Supports 400 functions.", "\d+")
gives the result TRUE
SJS.REGEXMATCH("My Name is (John Smith)", "\(([\w]+)\)")
gives the result TRUE
SJS.REGEXMATCH("Red", "[^red]", "i")
gives the result FALSE
Errors
returns a #VALUE! error if the value type of text or regular_expression is not text.
returns a #N/A error if the length of the parameters < 2.
returns a #NAME error if any parameter is not valid.