fork download
  1. import re
  2.  
  3. string1 = "Helloworld33"
  4. string2 = "3hi3"
  5.  
  6. valid = not any(sub.group(1) in string2 for sub in re.finditer(r"(?=(.{3}))", string1))
  7. print(valid)
Success #stdin #stdout 0.08s 8832KB
stdin
Standard input is empty
stdout
True