Skip to content

Instantly share code, notes, and snippets.

@Abhayparashar31
Last active August 8, 2022 05:45
Show Gist options
  • Save Abhayparashar31/9a7895878e5ffe06c8b6566df96bbe9d to your computer and use it in GitHub Desktop.
Save Abhayparashar31/9a7895878e5ffe06c8b6566df96bbe9d to your computer and use it in GitHub Desktop.
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