Advertisement
here2share

# str_regex-like_replace.py

Sep 7th, 2015
236
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.21 KB | None | 0 0
  1. # str_regex-like_replace.py -- easier to understand
  2.  
  3. def repl(s):
  4.         for c in list('#$!/:^?@')+['xyz']:
  5.                 s=s.replace(c,'')
  6.         return s
  7. print repl("a#b$c@xyz1!2?3/4zzz:5^6xyz.pyx/y/z")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement