Added option to set custom regex