CYF200127 commited on
Commit
dcad5d1
·
verified ·
1 Parent(s): 6c0851b

Update molnextr/constants.py

Browse files
Files changed (1) hide show
  1. molnextr/constants.py +2 -1
molnextr/constants.py CHANGED
@@ -245,4 +245,5 @@ COLORS = {
245
 
246
  # tokens of condensed formula
247
  FORMULA_REGEX = re.compile(
248
- '(' + '|'.join(list(ABBREVIATIONS.keys())) + '|R[0-9]*|[A-Z][a-z]+|[A-Z]|[0-9]+|\(|\))')
 
 
245
 
246
  # tokens of condensed formula
247
  FORMULA_REGEX = re.compile(
248
+ '(?:' + '|'.join([re.escape(k) for k in ABBREVIATIONS.keys()]) + '|R[0-9]*|[A-Z][a-z]+|[A-Z]|[0-9]+|\(|\))')
249
+