11# A part of NonVisual Desktop Access (NVDA)
2- # Copyright (C) 2010-2023 NV Access Limited, World Light Information Limited,
2+ # Copyright (C) 2010-2024 NV Access Limited, World Light Information Limited,
33# Hong Kong Blind Union, Babbage B.V., Julien Cochuyt, Cyrille Bougot
44# This file is covered by the GNU General Public License.
55# See the file COPYING for more details.
@@ -528,13 +528,7 @@ def __init__(self, locale):
528528 multiChars .sort (key = lambda identifier : len (identifier ), reverse = True )
529529
530530 # Build the regexp.
531- patterns = [
532- # Strip repeated spaces from the end of the line to stop them from being picked up by repeated.
533- r"(?P<rstripSpace> +$)" ,
534- # Repeated characters: more than 3 repeats.
535- r"(?P<repeated>(?P<repTmp>%s)(?P=repTmp){3,})" % characters
536- ]
537- # Complex symbols.
531+ patterns = []# Complex symbols.
538532 # Each complex symbol has its own named group so we know which symbol matched.
539533 patterns .extend (
540534 u"(?P<c{index}>{pattern})" .format (index = index , pattern = symbol .pattern )
@@ -546,6 +540,12 @@ def __init__(self, locale):
546540 multiChars = "|" .join (re .escape (identifier ) for identifier in multiChars ),
547541 singleChars = characters
548542 ))
543+ patterns .extend ([
544+ # Strip repeated spaces from the end of the line to stop them from being picked up by repeated.
545+ r"(?P<rstripSpace> +$)" ,
546+ # Repeated characters: more than 3 repeats.
547+ r"(?P<repeated>(?P<repTmp>%s)(?P=repTmp){3,})" % characters
548+ ])
549549 pattern = "|" .join (patterns )
550550 try :
551551 self ._regexp = re .compile (pattern , re .UNICODE )
0 commit comments