fork download
  1. import re
  2.  
  3. pattern="[0-9]{1,2}(?: [0-9]{1,2})*$"
  4. check="01 03"
  5. a=re.match(pattern,check)
  6. if a:
  7. print('Not valid value')
  8. else:
  9. print("valid value")
Success #stdin #stdout 0.02s 27712KB
stdin
Standard input is empty
stdout
Not valid value