Module lessons (1/4)
All flags in detail
g i m s u v y d: what each one does and how they combine.
What you'll learn in this lesson
- Choose the right combination from all modern JavaScript flags (
g,i,m,s,u,v,y,d). - Use the
s(dotAll) flag to also match the carriage return characters\nto the dot.. - Understand the basics of the
vflag (unicodeSets, ES2024) for set operations such as subtraction--and intersection&&.
Overview
flags are single-letter modifiers that change the behavior of the entire regex engine without rewriting the pattern. They can be combined in any order after the closing slash (JavaScript then orders them canonically in re.flags).
Think of flags like switches on the regex dashboard: the pattern describes what to look for, while the flags decide how the engine interprets the text (all of it or just the first match? Case sensitive? Multiline? Advanced Unicode?).
Sections covered in this lesson
- 1Mental model: engine configuration switches
- 24 progressive examples step by step
- 3Guided practical exercises
- 4Quick check
Unlock "All flags in detail" and the full Regex Course curriculum
`g i m s u v y d`: what each one does and how they combine.
Unlock all 5 hands-on exercises in this lesson plus every advanced WebAssembly module with automated checks.
- Instant access to all advanced modules in Regex Course plus 17 more courses
- Hands-on browser exercises with automated test suites and solutions
- 14-day money-back guarantee processed via Paddle.com
14-day guarantee · Cancel anytimeModule 1, all 18 interactive games, and cheatsheets are always free.