I try to Remove extra char from this URL(Please watch snapshot)
but I can't make it perfect URL format, and I try this code
import re
p = re.compile(r'(?:\w*://)?(?:.*?\.)?(?:([a-zA-Z-1-9]*)\.)?([a-zA-Z-1-9]*\.[a-zA-Z]{1,}).*')
domain = 'https://test.com/ABC]VR͜'
print(p.match(domain))
but still, it gives output
where I need output like
So, is there any build-in method in python to do that? or if need to make manually any way without regular expression? if no way without regular expression then how to do that with a regular expression?
Thank you.