lexer: prepend ^ to regexes only once

This speeds up the parsing process by another 50%, roughly.