I'm trying to verify card numbers using REGEX. All characters must be digits (0-9), if the first digit is 3 the number can either be 15 or 16 characters long, if the number doesn't start with 3, it must be 16 characters long.
Is there a way to use conditional statements in pure regex, not using an external library?