JavaScript ignoreCaseProperty

RegExp 对象参考手册JavaScript RegExp Object

Definition and Usage

The ignoreCase property specifies whether to set "i" the flag.

If the "i" flag is set, it returns true, otherwise it returns false.

Syntax

RegExpObject.ignoreCase


Browser Support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support the ignoreCase property.


Examples

Examples

Check whether the "i" flag is set:

var str="Visit EXAMPLE!"; var patt1=/RUN/i; if(patt1.ignoreCase) { document.write("i mode is set!"); } else { document.write("i mode is not set!"); }

Try it Yourself »


RegExp 对象参考手册JavaScript RegExp Object Other Extensions