A regex can be translated to a finite state machine. N regex can also be compiled to a (bigger) state machine. The longest-match-wins, ties go to the earlier regex lexer semantic needs a register/int value to track where the current favourite match ended and a second to track which regex matched. Can probably drop one of those registers if preferred.
That takes a pointer into your string, returns the index into your N regex or an indication of failure. Either it moves the pointer along or returns a length as well.
No dynamic allocation. Constant stack space. Couple of machine registers in the interface. Linear time through the input array (slightly handwaving that since some bytes get read multiple times to disambiguate which match is preferred, but it's bounded by a constant factor of the N regex).
Probably read a byte of the input at a time. The C output of re2c is especially clear for seeing why the compiled machine works.
A nice quirk of the above is equivalent regex turn into the same minimal state machine so it doesn't matter how the regex are written. Literals are the same performance as regex specifying that literal.