1 2 3 g modifier: global. All matches (don't return on first match) i modifier: insensitive. Case insensitive match (ignores case of [a-zA-Z])
In your case though
i is immaterial as you don’t capture
For input like
g modifier is not there regex will return first match
! See here.
g is there it will return the whole or whatever it can match See here.