Regular expressions pcre2 · Using regex in tools
Match in JavaScript
Extract the parts of a date with a regular expression literal.
const [, year, month, day] = "2026-10-30".match(/(\d{4})-(\d{2})-(\d{2})/);
Official Regular expressions pcre2 documentation
More using regex in tools commands
- Search with grep
- Use lookarounds with grep
- Rewrite text with sed
- Replace in JavaScript
- Find all matches in Python
- Replace in Python
All using regex in tools commands · Regular expressions pcre2 cheatsheet