Summary
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 | No |
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
Example: Using ignoreCase
var regex = new RegExp("foo", "i")
console.log(regex.ignoreCase) // true
Specifications
| Specification | Status | Comment |
|---|---|---|
| ECMAScript 3rd Edition. Implemented in JavaScript 1.2. | Standard | Initial definition. JavaScript 1.5: ignoreCase is a property of a RegExp instance, not the RegExp object. |
| ECMAScript Language Specification 5.1th Edition (ECMA-262) | Standard | |
| ECMAScript Language Specification 6th Edition (ECMA-262) | Draft | ignoreCase is now a prototype accessor property rather than an instance's own data property. |
Browser compatibility
| Feature | Chrome | Firefox (Gecko) | Internet Explorer | Opera | Safari |
|---|---|---|---|---|---|
| Basic support | (Yes) | (Yes) | (Yes) | (Yes) | (Yes) |
| Feature | Android | Chrome for Android | Firefox Mobile (Gecko) | IE Mobile | Opera Mobile | Safari Mobile |
|---|---|---|---|---|---|---|
| Basic support | (Yes) | (Yes) | (Yes) | (Yes) | (Yes) | (Yes) |