RegExp.ignoreCase
JavaScript 1.2+, JScript 3.0+ Nav4+, NES3+, IE4+ Syntax
regexp.ignoreCase
Description
The ignoreCase property of the RegExp object is a flag that informs the user if case is to be ignored during pattern matching or not.
Example
Listing 6.217 shows how ignoreCase is used.
Listing 6.217 Example of ignoreCase
<html> <body> <script language="JavaScript"> <!–– Hide // defines a regular expression on the pattern "and" // with the ignore case flag set. var myPat = new RegExp("and", "i"); // define a string var str = "Would Missy and Livvy like some Candy?"; // store results of exec into myArray myArray = myPat.exec(str); document.write("The value of RegExp.ignoreCase is: " + "<b>" + myPat.ignoreCase + "</b>"); // End Hide ... |
Get Pure JavaScript now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.