You are viewing a single comment's thread. Return to all comments →
import re for _ in range(int(input())): if re.search(r'^(?<=[4-6])(?!.*(.)(-?\1){3}.*)(\d{4})(-?\d{4}){3}$', input()): print('Valid') else: print('Invalid')
Seems like cookies are disabled on this browser, please enable them to open this website
Validating Credit Card Numbers
You are viewing a single comment's thread. Return to all comments →
im getting all cases invalid, please help