Skip to content

Instantly share code, notes, and snippets.

@sial-ari
Created March 31, 2012 20:38
Show Gist options
  • Save sial-ari/2268288 to your computer and use it in GitHub Desktop.
Save sial-ari/2268288 to your computer and use it in GitHub Desktop.
function that removes plus sign from given text
import re
def filter_remove_plus(text):
pattern = re.compile('^\+')
lines = text.split('\n')
new_text = ""
for line in lines:
filtered_text = pattern.sub("", line)
new_text = new_text + filtered_text + "\n"
return new_text
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment