fork download
  1. import re
  2. o = r'(?:25[0-5]|2[0-4][0-9]|[0-1]?[0-9][0-9]?)'
  3. regex = fr'\b{o}(?:\.{o}){{3}}\b'
  4. # OR regex = fr'(?<!\d)(?<!\d\.){o}(?:\.{o}){{3}}(?!\.?\d)'
  5. url_string = "http://110.234.52.124/paypal.ca/index.html"
  6. print( bool(re.search(regex, url_string, re.X)) )
Success #stdin #stdout 0.03s 9756KB
stdin
Standard input is empty
stdout
True