Regex Overview

Regex Flags

🙋 Need help? Ask an expert now!

Regular expression has optional flags that allow global and case insensitive searching if needed. These flags are not used in JavaScript as often as they are in shell scripts and the command line. The flags can be used separately or together in any order. Below is a list of the flags and what they represent:

  • g -> global search (find all matches rather than stopping after the first match)
  • i -> case insensitive search
  • m -> multi-line search
Edit Me on GitHub!