Let's say I have the following table (called filetable) with file names:
file
something.h
something.cc
somethingelse.js
something.py
something.xkh
something.jpeg
I tried the following query:
select file
from filetable
where file ~ E'\.[cc|h|js|py]';
The query output is:
file
something.h
something.cc
somethingelse.js
something.py
something.xkh
something.jpeg
However, I only need files that finish exactly with .cc , .h , .js , .py. How to improve this query?