File tree 1 file changed +3
-3
lines changed
1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -109,12 +109,12 @@ def or_regex(symbols: List[str]) -> Pattern:
109
109
DOLLAR_CODES = [k for k in CURRENCY_CODES if k .endswith ('D' )]
110
110
_DOLLAR_REGEX = re .compile (
111
111
r'''
112
- \b
112
+ ( \b
113
113
(?:{}) # currency code like NZD
114
114
(?=
115
115
\$? # dollar sign to ignore if attached to the currency code
116
116
(?:[\W\d]|$) # not a letter
117
- )
117
+ ))
118
118
''' .format ('|' .join (re .escape (k ) for k in DOLLAR_CODES )),
119
119
re .VERBOSE ,
120
120
)
@@ -142,7 +142,7 @@ def or_regex(symbols: List[str]) -> Pattern:
142
142
OTHER_CURRENCY_SYMBOLS = sorted (OTHER_CURRENCY_SYMBOLS_SET ,
143
143
key = len , reverse = True )
144
144
145
- _search_dollar_code = re . compile ( "|" . join ( DOLLAR_REGEXES ), re . VERBOSE ) .search
145
+ _search_dollar_code = _DOLLAR_REGEX .search
146
146
_search_other_particular_regexes = re .compile ("|" .join (OTHER_PARTICULAR_REGEXES ), re .VERBOSE ).search
147
147
_search_safe_currency = or_regex (SAFE_CURRENCY_SYMBOLS ).search
148
148
_search_unsafe_currency = or_regex (OTHER_CURRENCY_SYMBOLS ).search
You can’t perform that action at this time.
0 commit comments