What it does
Match file names that end in .csv or .json.
How to use it
- Load the example or paste file names, one per line with the line-by-line scope.
- Check the counterexample.
- Add further extensions to the group if you need them.
Verified example
Example
Text "report.csv"
\.(?:csv|json)$ Result: ".csv"
\.(?:csv|json)$ Result: ".csv"
\.(?:csv|json)$ Result: ".csv"
\.(?:csv|json)$ Result: ".csv"
Counterexample
Text "report.csv.bak"
\.(?:csv|json)$ Result: no match
\.(?:csv|json)$ Result: no match
\.(?:csv|json)$ Result: no match
\.(?:csv|json)$ Result: no match
Recorded by running fixture FX-R06 on : rp.js@1 on Node v24.21.0 (V8), v24.21.0, CPython 3.14.2 (Pyodide 314.0.7), PCRE2 10.48, go1.27.1. JavaScript results come from the rp.js@1 core on Node’s V8; your browser runs the same core.
Engines
- $ also matches before a final line feed in Python and PCRE2; run line by line to avoid surprises.
Limits
- Case-sensitive: .CSV does not match unless you set flag i.