There seems to be a lot of questions asking for regex to detect a CSV file type, but none for javascript.
Given that a regular expression for images looks like /^image\/(gif|jpeg|png)$/
, does anyone know what the same would look like for CSV?
Edit To be a little more clear, looking for both a "how-to" to regex check if file is a CSV and the common extensions associated. Thanks!
The CSV file extension is typically .csv
. So try matching against that:
.+(\.csv)$
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With