Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

JavaScript ignoreCase property

JavaScript ignoreCase property

RegExp Object Reference JavaScript RegExp Object


Definition and Usage

The ignoreCase property indicates whether the "i" flag is set.

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.


Example

Example

Check whether the "i" flag is set:

var

str

=

"

Visit RUNOOB!

"

;

var

patt1

=/

RUN

/

i

;

if

(

patt1

.

ignoreCase

)

{

document

.

write

(

"

The i flag is set!

"

)

;

}

else

{

document

.

write

(

"

The i flag is not set!

"

)

;

}

Try it »


RegExp Object Reference JavaScript RegExp Object