Adding option to pass regex