Throw NPE when regex pattern is null