Skip to content

Commit

Permalink
fix: πŸ› inefficient regular expression
Browse files Browse the repository at this point in the history
  • Loading branch information
noshita committed Mar 12, 2024
1 parent 394464d commit a2d04a2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ktch/io/_tps.py
Original file line number Diff line number Diff line change
Expand Up @@ -224,11 +224,11 @@ def write_tps(
flags=re.MULTILINE,
)
PTN_CURVES = re.compile(
r"^(?P<CURVES>CURVES\s*=\s*[0-9]+\s*(?P<POINTS>(POINTS\s*=\s*[0-9]+\s*[0-9\s\.-]+)+))$",
r"^(?P<CURVES>CURVES\s*=\s*[0-9]+\s+(?P<POINTS>(POINTS\s*=\s*[0-9]+\s+[0-9\s\.-]+)+))$",
flags=re.MULTILINE,
)
PTN_POINTS = re.compile(
r"^(?P<POINTS>POINTS\s*=\s*[0-9]+\s*([\w\.-]+\s+[\w\.-]+\s*[\w\.-]*\s*)+)",
r"^(?P<POINTS>POINTS\s*=\s*[0-9]+\s+([\w\.-]+\s+[\w\.-]+\s*[\w\.-]*\s*)+)",
flags=re.MULTILINE,
)

Expand Down

0 comments on commit a2d04a2

Please sign in to comment.