I've got a regex pattern which I am using to match files having particular extensions. However I do NOT want it to match any .Designer.cs files; how would I implement such into my pattern?
\.(bat|cs|java|html|etc)$
I've got a regex pattern which I am using to match files having particular extensions. However I do NOT want it to match any .Designer.cs files; how would I implement such into my pattern?
\.(bat|cs|java|html|etc)$
You need to use a negative look-behind, like this:
(?<!\.Designer)\.(bat|cs|java|html|etc)$
there are some "online regex" - Tester. I was successful with:
.*(?<!.designer)(\.bat|\.cs|\.java|\.html|\.etc)$
(only milliseconds too late ... :-(