Last active
April 10, 2023 05:52
-
-
Save bhavik-knight/0f2f125694344b238439a9d71803ba7b 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 | |
text = "hey Google, this is from Harsh's tutorial https://www.louvre.fr/en/ check http://35.182.245.62/index.php?# 😉 or https://facebook.com 😀 " | |
text_using_harsh_reference = re.sub("https?:\/\/[a-z0-9-]+(?:\.[a-z0-9-]+)+[/?#]\S*", "", text) | |
print(text_using_harsh_reference) | |
text_fixed = text = re.sub("https?:\/\/[a-z0-9-]+(?:\.[a-z0-9-]+)+[/?\S?#]*", "", text) | |
print(text_fixed) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment