c# - Create validation for CSV and Text file only (case insenstive) -


this question has answer here:

i wants upload file extension .csv , .txt , case insensitive.

for example .csv, .csv, .csv, .txt, .txt , .txt ...

i using one

(?i)[.](csv|txt) 

but not work when extension case-sensitive.

this regex in both client side , server side validation:

^.*\.([cc][ss][vv]|[tt][xx][tt]??)$ 

if want atleast 1 character name (before .txt or .csv) following help:

^.+\.([cc][ss][vv]|[tt][xx][tt]??)$ 

Comments

Popular posts from this blog

linux - Does gcc have any options to add version info in ELF binary file? -

android - send complex objects as post php java -

charts - What graph/dashboard product is facebook using in Dashboard: PUE & WUE -