Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How would I match `.scss`, `.sass`, `.css` but not `.ass`? (RegExp)

I have the following regex: /\.([s]?[ac]ss)$/. The problem is, it matches .scss, .sass, .css, .ass. How would I make it not match .ass?

like image 768
Kyuzu Avatar asked Sep 07 '25 03:09

Kyuzu


1 Answers

Also this will match .scss, .sass and .css only, it is very readable and self-explanatory

/\.(sc|sa|c)ss$/
like image 64
Fabrizio Calderan Avatar answered Sep 10 '25 09:09

Fabrizio Calderan