define regex outside of middleware to add performance