JavaScript: Regex Functions
Here is a overview of regex functions. (For a basic intro to regex, see RegExp Tutorial)
str.search(regex)
- Return the position of the match. [see String.prototype.search]
str.match(regex)
- Return a Array of captured groups, or all occurrences. [see String.prototype.match]
str.matchAll(regex)
- Return a Iterable of all occurrences and captures. [see String.prototype.matchAll]
str.replace(regex, str_or_func)
- Return a new string. [see String.prototype.replace]
str.replaceAll(regex, str_or_func)
- Return a new string. [see String.prototype.replaceAll]
regex.test(str)
- Return true/false. [see RegExp.prototype.test]
regex.exec(str)
- Return captured groups. [see RegExp.prototype.exec]