fork(4) download
  1. import re
  2. p = re.compile(r"""^ # At the start of the string, ...
  3. (?! # check if next characters are not...
  4. www\. # URLs starting with www.
  5. |
  6. (?:http|ftp)s?:// # URLs starting with http, https, ftp, ftps
  7. |
  8. [A-Za-z]:\\ # Local full paths starting with [drive_letter]:\
  9. |
  10. // # UNC locations starting with //
  11. ) # End of look-ahead check
  12. .* # Martch up to the end of string""", re.X)
  13. print(p.search("./about.html"));
  14. print(p.search("//dub-server1/mynode"));
Success #stdin #stdout 0.01s 7736KB
stdin
Standard input is empty
stdout
<_sre.SRE_Match object at 0xb7483678>
None