Valid digits operator and check precedence of them