This documentation is archived and is not being maintained.

ignoreCase Property 

Returns a Boolean value indicating the state of the ignoreCase flag (i) used with a regular expression.



Required. An instance of a Regular Expression object.

The ignoreCase property is read-only, and returns true if the ignoreCase flag is set for a regular expression, and returns false if it is not. The default value is false.

The ignoreCase flag, when used, indicates that a search should ignore case sensitivity when matching the pattern within the searched string.

The following example illustrates the use of the ignoreCase property.

function RegExpPropDemo(re : RegExp) {
   print("Regular expression: " + re);
   print("global:     " +;
   print("ignoreCase: " + re.ignoreCase);
   print("multiline:  " + re.multiline);

// Some regular expression to test the function.
var re1 : RegExp = new RegExp("the","i");  // Use the constructor.
var re2 = /\w+/gm;                         // Use a literal.

The output of this program is:

Regular expression: /the/i
global:     false
ignoreCase: true
multiline:  false

Regular expression: /\w+/gm
global:     true
ignoreCase: false
multiline:  true

Regular expression: /^\s*$/im
global:     false
ignoreCase: true
multiline:  true