new regex code example
Example 1: javascript new Regexp with flag
new RegExp(/ab+c/, 'i') // literal notation
new RegExp('ab+c', 'i') // constructor
const pattern='some pattern';
new RegExp(pattern)
Example 2: Define REGEXP?
REGEXP is a pattern match in which matches pattern anywhere in the search value.