import re

with open("buddhist.txt","r") as file:
    wiki = file.read()

print(wiki)

pattern="""
(?P<title>.*)        #the university title
(–\ located\ in\ )   #an indicator of the location
(?P<city>\w*)        #city the university is in
(,\ )                #separator for the state
(?P<state>\w*)       #the state the city is located in"""

for item in re.finditer(pattern,wiki,re.VERBOSE):
    print(item.groupdict())


print("####################")

print("####################")

print("####################")

text = 'I refer to https://google.com and I never refer http://www.baidu.com if I have to search anything'

pattern="(?<=[https]:\/\/)([A-Za-z0-9.]*)"

print(re.findall(pattern,text))

print("####################")

print("####################")

print("####################")

with open("phoneNumbers.txt") as file:
    phones=file.read()
print(phones)

pattern="[(]\d{3}[)]\s\d{3}[-]\d{4}"
print(re.findall(pattern,phones))
57e448e5f2b7df0ac1ca5f90ae6076669641d270
<mask token>

<mask token>
with open('buddhist.txt', 'r') as file:
    wiki = file.read()
print(wiki)
<mask token>
for item in re.finditer(pattern, wiki, re.VERBOSE):
    print(item.groupdict())
print('####################')
print('####################')
print('####################')
<mask token>
print(re.findall(pattern, text))
print('####################')
print('####################')
print('####################')
with open('phoneNumbers.txt') as file:
    phones = file.read()
print(phones)
<mask token>
print(re.findall(pattern, phones))

<mask token>
with open('buddhist.txt', 'r') as file:
    wiki = file.read()
print(wiki)
pattern = """
(?P<title>.*)        #the university title
(–\\ located\\ in\\ )   #an indicator of the location
(?P<city>\\w*)        #city the university is in
(,\\ )                #separator for the state
(?P<state>\\w*)       #the state the city is located in"""
for item in re.finditer(pattern, wiki, re.VERBOSE):
    print(item.groupdict())
print('####################')
print('####################')
print('####################')
text = (
    'I refer to https://google.com and I never refer http://www.baidu.com if I have to search anything'
    )
pattern = '(?<=[https]:\\/\\/)([A-Za-z0-9.]*)'
print(re.findall(pattern, text))
print('####################')
print('####################')
print('####################')
with open('phoneNumbers.txt') as file:
    phones = file.read()
print(phones)
pattern = '[(]\\d{3}[)]\\s\\d{3}[-]\\d{4}'
print(re.findall(pattern, phones))

import re
with open('buddhist.txt', 'r') as file:
    wiki = file.read()
print(wiki)
pattern = """
(?P<title>.*)        #the university title
(–\\ located\\ in\\ )   #an indicator of the location
(?P<city>\\w*)        #city the university is in
(,\\ )                #separator for the state
(?P<state>\\w*)       #the state the city is located in"""
for item in re.finditer(pattern, wiki, re.VERBOSE):
    print(item.groupdict())
print('####################')
print('####################')
print('####################')
text = (
    'I refer to https://google.com and I never refer http://www.baidu.com if I have to search anything'
    )
pattern = '(?<=[https]:\\/\\/)([A-Za-z0-9.]*)'
print(re.findall(pattern, text))
print('####################')
print('####################')
print('####################')
with open('phoneNumbers.txt') as file:
    phones = file.read()
print(phones)
pattern = '[(]\\d{3}[)]\\s\\d{3}[-]\\d{4}'
print(re.findall(pattern, phones))

import re

with open("buddhist.txt","r") as file:
    wiki = file.read()

print(wiki)

pattern="""
(?P<title>.*)        #the university title
(–\ located\ in\ )   #an indicator of the location
(?P<city>\w*)        #city the university is in
(,\ )                #separator for the state
(?P<state>\w*)       #the state the city is located in"""

for item in re.finditer(pattern,wiki,re.VERBOSE):
    print(item.groupdict())


print("####################")

print("####################")

print("####################")

text = 'I refer to https://google.com and I never refer http://www.baidu.com if I have to search anything'

pattern="(?<=[https]:\/\/)([A-Za-z0-9.]*)"

print(re.findall(pattern,text))

print("####################")

print("####################")

print("####################")

with open("phoneNumbers.txt") as file:
    phones=file.read()
print(phones)

pattern="[(]\d{3}[)]\s\d{3}[-]\d{4}"
print(re.findall(pattern,phones))