test(str)

match(regex) to return multiple occurrences with a single function execution.

Execute the search for a regular expression match in a string. Return true if the match is found, false otherwise. This function is an implementation of the standard JavaScript RegExp test() method.

Example

var str = 'Many free Java resources are available.'
var pattern = new RegExp(".*JavA.*", 'i');
pattern.test(str); // returns true