Skip to content

Commit

Permalink
pgn: Improve validation of symbol tokens for tag names
Browse files Browse the repository at this point in the history
  • Loading branch information
laniakea64 authored and niklasf committed Jul 9, 2022
1 parent 43dc84a commit 77794ce
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions chess/pgn.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,9 @@
NAG_NOVELTY = 146


TAG_REGEX = re.compile(r"^\[([A-Za-z0-9_+#=:-]+)\s+\"([^\r]*)\"\]\s*$")
TAG_REGEX = re.compile(r"^\[([A-Za-z0-9][A-Za-z0-9_+#=:-]{,254})\s+\"([^\r]*)\"\]\s*$")

TAG_NAME_REGEX = re.compile(r"^[A-Za-z0-9_+#=:-]+\Z")
TAG_NAME_REGEX = re.compile(r"^[A-Za-z0-9][A-Za-z0-9_+#=:-]{,254}\Z")

MOVETEXT_REGEX = re.compile(r"""
(
Expand Down

0 comments on commit 77794ce

Please sign in to comment.