RegExp.prototype.ignoreCase

The ignoreCase property indicates whether or not the "i" flag is used with the regular expression. ignoreCase is a read-only property of an individual regular expression instance.

Property attributes of RegExp.prototype.ignoreCase
Writable no
Enumerable no
Configurable yes

Description

The value of ignoreCase is a Boolean and true if the "i" flag was used; otherwise, false. The "i" flag indicates that case should be ignored while attempting a match in a string.

You cannot change this property directly.

Examples

Using ignoreCase

var regex = new RegExp('foo', 'i');

console.log(regex.ignoreCase); // true

Specifications

Specification
ECMAScript Language Specification
# sec-get-regexp.prototype.ignorecase

Browser compatibility

Report problems with this compatibility data on GitHub
desktopmobileserver
ChromeEdgeFirefoxInternet ExplorerOperaSafariWebView AndroidChrome AndroidFirefox for AndroidOpera AndroidSafari on iOSSamsung InternetDenoNode.js
ignoreCase
Prototype accessor property (ES2015)

Legend

Full support
Full support

See also