i was learning the cryptography where i got the assignment for building the primitive root for the given number so before doing the calculation i need to check that a number must be any of these form
[2,4,p^t,2p^t]
is their any regex that can check that?? if not then is their any way i can check that number is built up from this form??