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

@ -394,7 +394,7 @@ def walk_on_files(inDirPath, outDirPath):
def findStartCode(fd,full_path):
inFD = open(full_path, "r")
textFile =inFD.read()
textFile = inFD.read()
inFD.close()
#print "-" * 80
#print textFile
@ -453,7 +453,7 @@ def replaceTextInline(text, pathOfFile, searchText):
print >> sys.stderr, '*' * 80
print >> sys.stderr, text
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
match = re.search(rePattern, text)