DFAs are the theory that lexer generators like flex and RE2 compile down to: every token pattern becomes states and transitions exactly as you are building by hand. Google's RE2 rejects backtracking entirely and runs pure automata so a malicious regex cannot DoS the service — a guarantee you can only appreciate after driving a lexer from a DFA yourself.