Last active
August 8, 2022 05:45
-
-
Save Abhayparashar31/9a7895878e5ffe06c8b6566df96bbe9d to your computer and use it in GitHub Desktop.
This file contains hidden or 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
doc = 'follow my medium profile at https://medium.com/@abhayparashar31 and subscribe to my email list at https://abhayparashar31.medium.com/subscribe' | |
import regex as re | |
re.sub(r'(http|https|ftp|ssh)://([\w_-]+(?:(?:\.[\w_-]+)+))([\w.,@?^=%&:/~+#-]*[\w@?^=%&/~+#-])?', '' , doc) | |
-------------------- | |
""" | |
follow my medium profile at and subscribe to my email list at. | |
""" | |
""" | |
(http|https|ftp|ssh) | |
:// | |
([\w_-]+(?:(?:\.[\w_-]+)+)) | |
([\w.,@?^=%&:/~+#-]*[\w@?^=%&/~+#-])? | |
""" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment