Last active
January 31, 2019 10:24
-
-
Save abuvanth/fee78ec5f94c19291ead770a01c05a1c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import re | |
fil=open('hhh','r') | |
fil2=open('splt.txt','a') | |
rgx=r'(https?:\/\/[a-zA-Z0-9._\-]+)(\/.+)' | |
for i in fil.readlines(): | |
m=re.search(rgx,i) | |
print(m.group(2)) #change 2 to 1 if you want hostname | |
fil2.write(m.group(2)+'\n') #change 2 to 1 if you want hostname |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment