added regex support to expose function