## Lesson — Check for the presence of the global ('g') flag

**Tags:** architecture, curated
**Pattern:** new\s+RegExp\s*\(\s*[^,]+\s*,\s*[^,]*\.flags\s*\+\s*['"][^'"]*g
**Engine:** regex
**Scope:** **/*.ts, **/*.tsx, **/*.js, **/*.jsx
**Severity:** error

Check for the presence of the global ('g') flag.
