new RegExp(/ab+c/, 'i') // literal notation new RegExp('ab+c', 'i') // constructor const pattern='some pattern'; new RegExp(pattern)