Guest User

Untitled

a guest
Jun 22nd, 2018
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.64 KB | None | 0 0
  1. validators_URL_gopher = re.compile(r'''
  2. ^(http|https|gopher)://
  3. (?:[%:\w]*@)? # authenticator
  4. (?P<domain>[a-z0-9][a-z0-9\-]{1,62}\.)* # (sub)domain - alpha followed by 62max chars (63 total)
  5. (?P<tld>[a-z]{2,}) # TLD
  6. (?::[0-9]+)? # port
  7.  
  8. # files/delims/etc
  9. (?P<path>/[a-z0-9\-\._~:/\?#\[\]@!%\$&\'\(\)\*\+,;=]*)?
  10. $
  11. ''', re.I | re.VERBOSE)
  12.  
  13. class SaveBookmarkForm(formencode.Schema):
  14. """ Handle the save bookmark form """
  15. tbUrl = validators.URL(not_empty=True, url_re=validators_URL_gopher)
Add Comment
Please, Sign In to add comment