They're not using state machines, in that case it just happens to be an implementation detail of the regular expression library they're using.
They're not using state machines, in that case it just happens to be an implementation detail of the regular expression library they're using.