This language is recognized by the parity-counting deterministic finite automaton with four states
The initial state is and the only accepting state is . Reading leaves the state unchanged, reading toggles , and reading toggles . The state therefore records exactly the parities of the numbers of 's and 's. Thus