Skip to content

Commit

Permalink
Fixup overescaped regexes
Browse files Browse the repository at this point in the history
  • Loading branch information
mmore500 committed May 18, 2024
1 parent 2fce2b1 commit 8d59413
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/dendropy/dataio/nexusprocessing.py
Original file line number Diff line number Diff line change
Expand Up @@ -480,9 +480,9 @@ def escape_nexus_token(label, preserve_spaces=False, quote_underscores=True):
return ""
if not preserve_spaces \
and "_" not in label \
and not re.search(r'''[\(\)\[\]\{\}\\/\\,\\;\\:\\=\\*'"\`\+\-\<\>\0\t\n]''', label):
and not re.search(r'''[()[\]{}\\\/,;:=*'"`+\-<>\\0\\t\\n]''', label):
label = label.replace(' ', '_').replace('\t', '_')
elif re.search(r'''[\(\)\[\]\{\}\\/\,\;\:\=\*'"\`\+\-\<\>\0\t\n\r ]''', label) \
elif re.search(r'''[()[\]{}\\\/,;:=*'"`+-<>\0\t\n\r ]''', label) \
or quote_underscores and "_" in label:
s = label.split("'")
if len(s) == 1:
Expand Down

0 comments on commit 8d59413

Please sign in to comment.