I want to use the following regular expression to retrieve modified files from an svn log, it works fine as a single line, but since it is complex, I want to use re.VERBOSEit to add a comment to it, and then it stops at work. What am I missing here? Thank!
revision='''r123456 | user | 2013-12-22 11:21:41 -0700 (Thu, 22 Dec 2013) | 1 line
Changed paths:
A /trunk/abc/python/test/module
A /trunk/abc/python/test/module/__init__.py
A /trunk/abc/python/test/module/usage.py
A /trunk/abc/python/test/module/logger.py
copied from test
'''
import re
print re.search('''
(?<=Changed\spaths:\n)
((\s{3}[A|M|D]\s.*\n)*)
[(?=\n)|]
''', revision, re.VERBOSE).groups()
print re.search('(?<=Changed\spaths:\n)((\s{3}[A|M|D]\s.*\n)*)[(?=\n)|]', revision).groups()[0]
The line I want to extract is:
A /trunk/abc/python/test/module
A /trunk/abc/python/test/module/__init__.py
A /trunk/abc/python/test/module/usage.py
A /trunk/abc/python/test/module/logger.py
source
share