JS Built-ins
RegExpignoreCasebeginner

RegExp ignoreCase β€” no i flag

πŸ“– 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

The ignoreCase property is false when the 'i' flag is not set.

Challenge: Verify that /hi/.ignoreCase equals false.

πŸ’‘ Hints (1)
  • β€’ Without the i flag, case-sensitive matching is used by default