Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- for reg, repl in ABRVS:
- match_object = reg.search(v)
- if match_object:
- match = match_object.group()
- if v.endswith(match):
- strip_end_period = False
- if isinstance(repl, basestring):
- sub = repl
- else:
- sub = repl(match_object)
- start = v.find(match)
- while start >= 0:
- stop = start + len(match)
- patches.append((sub, start, stop))
- v = v.replace(match, '*' * len(match), 1)
- start = v.find(match)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement