- Regular expressions are special strings that represent a search pattern. Also known as "regex" or "regexp", they help programmers match, search, and replace text.
- Regular expressions can appear cryptic because a few characters have special meaning.
- The goal is to combine the symbols and text into a pattern that matches what you want, but only what you want.
- JavaScript has multiple ways to use regexes. One way to test a regex is using the
.test()
method. The.test()
method takes the regex, applies it to a string (which is placed inside the parentheses), and returnstrue
orfalse
if your pattern finds something or not.