// -> script> body> html>
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 (RE, S) {
Var S1; // Declare the variable.
// Check if a string has a regular expression.
if (RE.TEST (s)) // Tests if it exists.
S1 = "Contains"; // S contains mode.
Else
S1 = "does not contain"; // S does not include mode.
Return ("'" S "" " " Re.Source ""); // Returns the string. }