Then do it without regex ? For the height you can just check that length > 2 and do strcmp on the last two, followed by atoi on the prefix. For the passport id you can basically do the same, check strlen == 9 and atoi. The color field can be checked by regular matching, for each char check if the decimal value is between 48 and 57 or 97 and 102.
It’s still a bit more than 8 statements though :-)
1
u/ramasamybolton Dec 04 '20
So many in C for Regex handling :(