JS Built-ins
RegExpignoreCasebeginner

RegExp ignoreCase β€” gi flags

πŸ“– Usage Example
const re = /hello/i
console.log(re.ignoreCase) // β†’ true
'HELLO'.match(re) // matches

Read RegExp.ignoreCase to check whether the 'i' flag is set on the regular expression.

RegExp.prototype.ignoreCase

With both g and i flags, ignoreCase is true.

Challenge: Verify that /hi/gi.ignoreCase equals true.

πŸ’‘ Hints (1)
  • β€’ ignoreCase checks only for the i flag