From 8b5ae6a803d61d5506bf89dc0650d02a38f58fac Mon Sep 17 00:00:00 2001 From: Chrys Date: Tue, 22 Oct 2019 00:56:52 +0200 Subject: [PATCH] fix regex --- src/fenrirscreenreader/core/punctuationManager.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/fenrirscreenreader/core/punctuationManager.py b/src/fenrirscreenreader/core/punctuationManager.py index ee42f6d8..a84e9764 100644 --- a/src/fenrirscreenreader/core/punctuationManager.py +++ b/src/fenrirscreenreader/core/punctuationManager.py @@ -40,8 +40,8 @@ class punctuationManager(): for key,item in customDict.items(): try: regexLbl = 'REGEX;' - if item.upper().startswith(regexLbl) and (len(item) > len(regexLbl)): - resultText = re.sub(str(key), seperator + str(item[len(regexLbl):]) + seperator, resultText) + if key.upper().startswith(regexLbl) and (len(key) > len(regexLbl)): + resultText = re.sub(str(key[len(regexLbl):]), seperator + str(item) + seperator, resultText) else: resultText = resultText.replace(str(key),seperator + str(item) + seperator) except Exception as e: