`g` (Global) finds all matches instead of stopping after the first match. `i` (Case Insensitive) matches regardless of upper/lowercase. `m` (Multiline) treats ^ and $ as beginning and end of each line. `s` (Dotall) allows the dot . to match newlines.