How to use JavaScript Regular Expressions
By Flavio Copes
Learn how to use JavaScript regular expressions to search, validate, extract, and replace text, with practical examples of patterns, groups, and flags.
~~~
- Introduction to Regular Expressions
- Hard but useful
- How does a Regular Expression look like
- How does it work?
- Anchoring
- Match items in ranges
- Matching a range item multiple times
- Negating a pattern
- Meta characters
- Regular expressions choices
- Quantifiers
- Optional items
- Groups
- Capturing Groups
- Using
match()andexec() - Noncapturing Groups
- Flags
- Inspecting a regex
- Escaping
- String boundaries
- Replacing using Regular Expressions
- Greediness
- Lookaheads: match a string depending on what follows it
- Lookbehinds: match a string depending on what precedes it
- Regular Expressions and Unicode