Sep-16-2018, 03:10 PM
Well,
As for asking for user input, that's easy:
re.compile("(https?://)?([^:^/]*)(:\\d*)?(.*)?")
will only catch the http(s) if it is there, and will match example.com. It will also match subdomain.example.com, but all of that will be in the second group. Is that what you wanted or did you want the subdomain to be in a separate group?As for asking for user input, that's easy:
url = input('Please input your website: ') match = GRUBER_URLINTEXT_PAT.match(url) if match is None: print('Invalid url.') else: print('That url is valid.')
Craig "Ichabod" O'Brien - xenomind.com
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures