# attempt to detect the start of a patch
# (this heuristic is borrowed from quilt)
diffre = re.compile(r'(?:Index:[ \t]|diff[ \t]|RCS file: |' +
'retrieving revision [0-9]+(\.[0-9]+)*$|' +
'(---|\*\*\*)[ \t])')
When improving the re, this should be corrected, too:
1. the three strings don't need the + operators, this just makes
reading the regexp harder.
2. only the first string is raw, so it is only luck that \. and \*
don't get evaluated as something unwanted:
>>> print repr(r'22\22' + '22\22')
'22\\2222\x12'
|