Throw error if pattern is not a regex. 
Throw error if pattern is not a regex. 

Using anything except a regex in options.pattern is not supported, throw an error if an invalid regex is passed in pattern.
iminif/html-replace-webpack-plugin