Closed binarybottle closed 10 years ago
In [8]: str = 'asdasd/adas/atlas/fooo/asdasd'
In [9]: re.subn(r'/atlas/(.*)/', r'/\1/atlas/', str)
Out[9]: ('asdasd/adas/fooo/atlas/asdasd', 1)
remember substitution order:
ordered standard string substitions then ordered regexp substituions
The following did not switch the order of folder names "left_surface" and the subject name folder:
Sink.inputs.regexp_substitutions = [(r'/left_surface/(.*)/', r'/\1/left_surface/')]