Revision 5353
Added by Aaron Marcuse-Kubitza almost 12 years ago
regexp.py | ||
---|---|---|
12 | 12 |
return str_ |
13 | 13 |
|
14 | 14 |
def sub_nested(re_, repl, str_): |
15 |
while True: |
|
16 |
str_, n = re.subn(re_, repl, str_) |
|
17 |
if n == 0: break |
|
18 |
return str_ |
|
15 |
return sub_recursive(lambda s: re.subn(re_, repl, s), str_) |
Also available in: Unified diff
regexp.py: sub_nested(): Use new sub_recursive()