Your regexp regex is fine, it just matches only one event. If you want a match for any situation, try
"x : in integer; y : in logic; z : in float;".scan(regexp)
which leads to an array with 3 elements containing an array of every 3 matches, i.e.
[ ["x", "in", "integer"], ["y", "in", "logic"], ["z", "in", "float"] ]
source share