(period) Matches any single character, except for line breaks.
Matches the preceding expression 0 or more times.
Matches the preceding expression 1 or more times.
Preceding expression is optional (Matches 0 or 1 times).
Matches the beginning of the string.
Matches the end of the string.
Matches any single digit character.
Matches any word character (alphanumeric & underscore).
Character Set: Matches any single character from the character within the brackets. You can also do a range such as [A-Z]
Matches one or more of any of the characters in the set.
Inside a character set, the ^ is used for negation. In this example, match anything that is NOT an uppercase letter.
There are five optional flags. They can be used separately or together and are placed after the closing slash. Example: /[A-Z]/g I’ll only be introducing 2 here.
case insensitive search
Capturing Parenthesis: Matches x and remembers it so we can use it later.
Non-capturing Parenthesis: Matches x and does not remembers it.
Lookahead: Matches x only if it is followed by y.
The reduce() method is used to apply a function to each element in the array to reduce the array to a single value.