Why there is too many matches?

17 hours ago 1
ARTICLE AD BOX

Have the following test string:

CREATE TABLE leagues(id integer primary key ON CONFLICT ABORT AUTOINCREMENT, name varchar(100), drafttype integer(1), scoringtype integer(1), roundvalues integer(1), leaguetype char(5), salary integer, benchplayers integer(1), leagueid INTEGER)

And trying to use following regex:

(ON CONFLICT \w+)* (AUTOINCREMENT)*

to match either the whole phrase ON CONFLICT ABORT AUTOINCREMENT or 1 or the other parts of the pattern.

I'm using gmi as an options on regex101 and getting 23 matches instead of 1.

What is wrong?

Thx.

EDIT:

Removing g option make it work, but why What is wrong with /g?

Read Entire Article