\s*any whitespace character, repeated any number of times
Group 1(input|output|inout) inputthe literal text input (case sensitive) outputthe literal text output (case sensitive) inoutthe literal text inout (case sensitive) \s+any whitespace character, repeated at least once
?repeats the group contents below at most once:
wirethe literal text wire (case sensitive) \s*any whitespace character, repeated any number of times
regthe literal text reg (case sensitive) \s*any whitespace character, repeated any number of times
\s*any whitespace character, repeated any number of times
Group 3(\[(\d+):(\d+)\])? ?repeats the group contents below at most once:
\[the literal [ (9110 / 1338 / 5B16)
\d+a digit, repeated at least once
:the literal : (5810 / 728 / 3A16)
\d+a digit, repeated at least once
\]the literal ] (9310 / 1358 / 5D16)
\s*any whitespace character, repeated any number of times
?repeats the group contents below at most once:
\w+any word character, repeated at least once
g modifier: global. Finds all matches instead of stopping after the first