A regex modifier is a character that instructs the search to do something it would not do by default. In this example, our modifier is g, which stands for global, and instructs the search to find all matches of the expression. If we did not include the g modifier, the search would find only the first match.