Exclude list of words in Express.js route

I have something like this in Express.js Framework

app.post('/:username/:slug', user.fn);

Now I want to come up with a regular expression that checks if slug is equal to certain words (profile, album, etc.) , pass to the next route and don't capture the slug and username.

any ideas ?

You should just put the more specific routes first:

app.post('/:username/profile', middlware)
app.post('/:username/album', middleware)
app.post('/:username/:slug', middleware)

But then again, I don't know what you're trying to accomplish