expr: simplify valid_identifier use