I'm trying to make a regex that will match with a number whose sum, it's parity, is even. So 802 (8+0+2) is even, and 902 (9+0+2) is odd. Apparently there is an arithmetic law to do this Regex without counting, or breaking any of Regex's rules. I've made a Regex for even numbers, but not for even parity.
Edit: It's allowed to accept leading zeros, and the number can be any length (obviously smaller than the max size an int can be in most languages)
Thanks!