RegExp i modifier
Definition and Usage
i modifier for performing case-insensitive match.
grammar
new RegExp("regexp","i")
或者更简单方式:
/regexp/i
或者更简单方式:
/regexp/i
Browser Support
All major browsers support i modifier.
Examples
Examples
For string "w3cschool" be case-insensitive search:
var str="Visit W3Cschool";
var patt1=/w3schools/i;
var patt1=/w3schools/i;
The marked text below shows where the expression gets a match:
Visit W3CSchool
try it"
JavaScript RegExp Object