fix regex

This commit is contained in:
Chrys 2019-10-22 00:56:52 +02:00
parent effb576089
commit 8b5ae6a803

View File

@ -40,8 +40,8 @@ class punctuationManager():
for key,item in customDict.items(): for key,item in customDict.items():
try: try:
regexLbl = 'REGEX;' regexLbl = 'REGEX;'
if item.upper().startswith(regexLbl) and (len(item) > len(regexLbl)): if key.upper().startswith(regexLbl) and (len(key) > len(regexLbl)):
resultText = re.sub(str(key), seperator + str(item[len(regexLbl):]) + seperator, resultText) resultText = re.sub(str(key[len(regexLbl):]), seperator + str(item) + seperator, resultText)
else: else:
resultText = resultText.replace(str(key),seperator + str(item) + seperator) resultText = resultText.replace(str(key),seperator + str(item) + seperator)
except Exception as e: except Exception as e: