JavaScript RegExp i modifier
JavaScript RegExp Object
Definition and Usage
The i modifier performs case-insensitive matching.
Syntax
new RegExp("
regexp
","i")
Or a simpler way:
/
regexp
/i
Browser support





All major browsers support the i modifier.
Example
Example
Perform a case-insensitive search for "runoob" in the string:
var str="Visit RUnoob";
var patt1=/runoob/i;
The text marked below shows where the expression found matches:
Visit
RUnoob
Try it »
JavaScript RegExp Object