What it is
A regular expression is a pattern language for matching, extracting, or validating text, and JavaScript's engine supports flags that change matching behavior such as case sensitivity or multiline mode.
When to use it
Use a regex tester while writing validation for form input, extracting fields from log lines, or debugging why a pattern matches more (or less) text than intended.
Gotchas & limits
JavaScript regex semantics differ subtly from PCRE, Python, or POSIX regex; a pattern that works in one language's playground may behave differently once it runs in a browser or Node.