I’m currently just starting my first Lua program and I have a .csv file to read in. I want to check if the file I’m reading in is truely a .csv file.
I’ve tried regex similiar to these but they just don’t work..
s = string.match(arg[1], "%A+\.csv$")
whats the correct way to do the regex in lua?
In Lua patterns, you escape the meaning of a special character by using
%, not\. Also,%Ameans a non-letter; a letter is%a(lowercase). So you seem to want one of these: