implement part of state machine for region parsing