Skip to content

Commit 4c9ab3b

Browse files
committed
example code
1 parent b7b1b31 commit 4c9ab3b

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
import re # for regular expression matching operations
2+
# import requests # for sending HTTP requests
3+
# from urllib.parse import urlsplit # for breaking URLs down into component parts
4+
# from collections import deque # is a list-like container with fast appends and pops on either end
5+
# from bs4 import BeautifulSoup # for pulling data out of HTML files of websites
6+
7+
8+
9+
# target_webpage = input("Enter a target url to have the emails scraped: ")
10+
# unscraped_url = deque(target_webpage)
11+
# scraped_url = set()
12+
# scraped_email = set()
13+
14+
15+
#===================================================================
16+
#Regex Examples
17+
#===================================================================
18+
19+
email = input("Type email: ")
20+
21+
regex = re.compile(r'([A-Za-z0-9]+[.-_])*[A-Za-z0-9]+@[A-Za-z0-9-]+(\.[A-Z|a-z]{2,})+')
22+
23+
24+
def isValid(email):
25+
if re.fullmatch(regex, email):
26+
print("Valid email")
27+
else:
28+
print("Invalid email")
29+
30+
isValid(email)

0 commit comments

Comments
 (0)