Skip to content

Instantly share code, notes, and snippets.

@MSWon
Created June 15, 2019 03:51
Show Gist options
  • Save MSWon/03b74900d0c58571a3348270031901dc to your computer and use it in GitHub Desktop.
Save MSWon/03b74900d0c58571a3348270031901dc to your computer and use it in GitHub Desktop.
get rid of duplicate symbol using regular expression
import re
line = "I don't go to school--with you ========== ------------ ........ *******"
re.sub(r"(\W)\1+", r"\1" , line)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment