1
0
Fork 0

Match inline docublocks non-greedy and prevent name collisions by expecting a whitespace character after block name

This commit is contained in:
Simran Brucherseifer 2016-07-18 11:12:15 +02:00
parent ade4b411b2
commit 90aaf2aed1
1 changed files with 2 additions and 2 deletions

View File

@ -453,7 +453,7 @@ def replaceTextInline(text, pathOfFile, searchText):
print >> sys.stderr, '*' * 80 print >> sys.stderr, '*' * 80
print >> sys.stderr, text print >> sys.stderr, text
exit(1) exit(1)
rePattern = r'(?s)\s*@startDocuBlockInline\s+'+ searchText +'.*@endDocuBlock\s' + searchText rePattern = r'(?s)\s*@startDocuBlockInline\s+'+ searchText +'\s.*?@endDocuBlock\s' + searchText
# (?s) is equivalent to flags=re.DOTALL but works in Python 2.6 # (?s) is equivalent to flags=re.DOTALL but works in Python 2.6
match = re.search(rePattern, text) match = re.search(rePattern, text)