JavaScript RegExp i Modifier
Complete RegExp Object Reference
Definition and Usage
When the i modifier is set the regular expression ignores the case of the
characters.
Syntax
new RegExp("regexp","i")
OR
/regexp/i
|
Parameter |
Description |
regexp |
Required. The rest of the regular expression to use |
Example
In the following code we will do a case insensitive search for "w3schools":
var str = "Visit W3Schools";
var patt1 = new RegExp("w3schools","i");
|
The marked text below shows where the RegExp gets a match:
Try-It-Yourself Demos
i
How to use the "i" modifier to do a case insensitive search for a sting using a string object.
i
How to use the "i" modifier to do a case insensitive search for a sting using a
regular expression object.
Complete RegExp Object Reference
 |

|
|
See why there are 20,000+ Ektron integrations worldwide.
Request an INSTANT DEMO or download a FREE TRIAL today. |
|
|
|