I wanna check the file is css file or not using regular expression. I tried
new RegExp(".css$").test("a.css"); //true
but it is matching filename.acss which is correct. I want regex to match a valid .css file only. I need following cases .
new RegExp(".css$").test("a.acss"); //false
new RegExp(".css$").test(".css"); //false
new RegExp(".css$").test("a.cssa"); //false
new RegExp(".css$").test("a.css"); //true
.character which matches anything, and needs to be escaped if you mean a real period.