Regular Expression to Match Multiples of 3

Alok Menghrajani (via Nicolas Seriot): An easier way to solve the problem requires understanding that regular expressions can be written as finite state machines, and vice versa. […] The state machine is going to process the input and keep track of the sum of the digits. We only need the sum modulo 3, so we’ll … Continue reading Regular Expression to Match Multiples of 3