News for hackers. Stuff that matters.
Re:Fast request routing using regular expressions by abecedarius on Thursday February 20, 2014 @12:28PM (#7272152)
You can compile the DFA exactly as you would with a single regex as input, just labeling each alternative's accept state differently. The subset construction would put a set of these labels on each DFA accepting state. When I coded this I had it break these ties by picking the minimum label in each set, so earlier alternatives win:

https://github.com/darius/sketchbook/blob/master/lex/dfa_nfa...

There are no comments on this comment yet.