Skip to content

Instantly share code, notes, and snippets.

@davidsaccavino
Last active May 13, 2018 17:31
Show Gist options
  • Save davidsaccavino/eb222febf37e22bf552346b2e3066d6f to your computer and use it in GitHub Desktop.
Save davidsaccavino/eb222febf37e22bf552346b2e3066d6f to your computer and use it in GitHub Desktop.
import re, sys
i = 0
message = ''
for elt in sys.argv:
if i > 0:
message += ' ' + elt
i += 1
langRegex = re.compile(r'visual\s*basic|vb[asic]*?|visual\s*b[asic]?|v[isual]?\s*b[asic]?|javascript|js|java\s*?s[cript]?|php|perl')
langSub = langRegex.sub('python', message, flags=re.I)
print(langSub)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment