Python Forum
Regex Subdomain Validation & Input website manual
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Regex Subdomain Validation & Input website manual
#1
Hello,
I have some code like this

import re, urllib

GRUBER_URLINTEXT_PAT = re.compile("(https?://)([^:^/]*)(:\\d*)?(.*)?")

for line in urllib.urlopen("https://pastebin.com/raw/hvGXKp72").readlines():
    print [ str(mgroups[1]).replace('\r\n','') for mgroups in GRUBER_URLINTEXT_PAT.findall(line) ]
this code to read
example.com
only without HTTP,HTTPS & WWW
Now i have a question , how to valid the Subdomain ? e.g
subdomain.example.com
is readable with the code?
and how to input manual the link website from
("https://pastebin.com/raw/hvGXKp72")
? e.g
Please Input Your Website :
then input the website manually.

Thank you in advace,
I hope anybody can help me.

Sorry for my bad english Angel Tongue
Reply


Messages In This Thread
Regex Subdomain Validation & Input website manual - by rtzki - Sep-16-2018, 02:13 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
Shocked Manual Splines? Power_Broker 4 1,253 Nov-08-2022, 01:49 AM
Last Post: Power_Broker
  input data validation plumberpy 2 1,870 Aug-11-2021, 12:04 PM
Last Post: plumberpy
Question Input validation goes south. Gilush 6 2,812 Dec-04-2020, 12:18 PM
Last Post: Gilush
  py2 to py3 manual conversion, dictonaries Vysero 8 5,227 Jun-06-2018, 08:33 PM
Last Post: snippsat

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020