Javascript Regular Expression Methods

Regular expression objects and string objects have methods that can utilize regular expressions.

Please visit syntax.html to see examples of regular expression syntax.

Regexes can use the test method to determine if a string contains a match. You can also use regexes with a string's search method. You can extract the pattern that matches your regex with string's match method. You can extract an array of matches with the "g" modifier. matchAll returns an iterator. Not an array. Repeated invocations of the exec method will eventually return all matches. This can lead to errors if you use the same RegExp object with different strings. regex.exec will keep trying to find matches until it runs out and then returns null.