Project

General

Profile

« Previous | Next » 

Revision 5353

regexp.py: sub_nested(): Use new sub_recursive()

View differences:

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