When to use it
- Use it to test whether a pattern matches text before writing code.
- It is useful for checking capture groups and match positions.
- It helps with validation, extraction, and search rules.
Flags, line breaks, or greedy matching may still prevent the expected result.
They let you extract or reuse specific parts of a match.
[ "foo" ]
[ "bar" ]
[ "foo" ]
Matches include positions and capture groups when available.