I"m using Mean.io and saw an regex in a modRewrite function:
app.use(modRewrite([
'!^/api/.*|\\_getModules|\\.html|\\.js|\\.css|\\.mp4|\\.swf|\\.jp(e?)g|\\.png|\\.gif|\\.svg|\\.ico|\\.eot|\\.ttf|\\.woff|\\.pdf$ / [L]'
]));
I understand that they're trying to rewrite the url to be prettier by replacing any urls containing:
/api/, _getModules, .html, .js, ..., .pdf
However, I have been searching in order to understand the regex but still can't figure it out what is the !^
at the beginning of the line and $
at the end of the line. Could someone please extract the regex step by step?