JavaScript RegExp ignoreCase property

Definition and usage

ignoreCase The property specifies whether the 'i' modifier is set.

If set "i" modifier, then this property returns true, otherwise returns false.

Description

The RegExp object's ignoreCase The property is a read-only boolean value.

It specifies whether the regular expression performs case-insensitive matching, such as whether the flag i was used when it was created.

Example

let pattern = /W3S/i;
let result = pattern.ignoreCase;

Try it yourself

Syntax

regexp.ignoreCase

Return value

Type Description
Boolean value Returns true if the 'i' modifier is set, otherwise returns false.

Browser support

ignoreCase It is a feature of ECMAScript1 (ES1).

All browsers fully support ES1 (JavaScript 1997):

Chrome IE Edge Firefox Safari Opera
Support Support Support Support Support Support