Test method
Returns a boolean value that indicates whether there is a mode in the string of the lookup.
RGEXP.TEST (STR)
parameter
RGEXP
required. Contains regular expressions objects that contain regular expression modes or available flags.
Str
required. To test the string of the lookup.
Description
Test method checks if there is a pattern in the string, if you exist, returns true, otherwise you return false.
The properties of the global regexp object are not modified by the Test method.
Example
The following example exemplifies the usage of the Test method:
Function TestDemo () {
Try {var re = "abc" var s = / a / / / here set regular expression Alert (S.Test (re)) // If included, return true} catch (e) {Alert ("ERR")} }
TestDemo () script>