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 GitHubdesktop | mobile | server | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
ignoreCase | ChromeFull support1 | EdgeFull support12 | FirefoxFull support1 | Internet ExplorerFull support5.5 | OperaFull support5 | SafariFull support1 | WebView AndroidFull support1 | Chrome AndroidFull support18 | Firefox for AndroidFull support4 | Opera AndroidFull support10.1 | Safari on iOSFull support1 | Samsung InternetFull support1.0 | DenoFull support1.0 | Node.jsFull support0.10.0 |
Prototype accessor property (ES2015) | ChromeFull support48 | EdgeFull support12 | FirefoxFull support38 | Internet ExplorerFull support5.5 | OperaFull support35 | SafariFull support1.3 | WebView AndroidFull support48 | Chrome AndroidFull support48 | Firefox for AndroidFull support38 | Opera AndroidFull support35 | Safari on iOSFull support1 | Samsung InternetFull support5.0 | DenoFull support1.0 | Node.jsFull support6.0.0 |
Legend
- Full support
- Full support
The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.