Skip to content

Commit

Permalink
Improve work code regex precision.
Browse files Browse the repository at this point in the history
  • Loading branch information
ch010060 committed Feb 1, 2023
1 parent 0330ddc commit 9837b1e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion dlsite_renamer-cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@

# re.compile()返回一個匹配對像
# ensure path name is exactly RJ?(\d{8}d{7}d{6}) or BJ?(\d{8}d{7}d{6}) or VJ?(\d{8}d{7}d{6})
pattern = re.compile("([BRV][EJ])?(\d{8}|\d{7}|\d{6})")
pattern = re.compile("([BRV][EJ])?(\d{8}|\d{7}|\d{6})|$")
# filter to substitute illegal filenanme characters to " "
filter = re.compile('[\\\/:"*?<>|]+')

Expand Down
2 changes: 1 addition & 1 deletion dlsite_renamer.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

# re.compile()返回一個匹配對像
# ensure path name is exactly RJ?(\d{8}d{7}d{6}) or BJ?(\d{8}d{7}d{6}) or VJ?(\d{8}d{7}d{6})
pattern = re.compile("([BRV][EJ])?(\d{8}|\d{7}|\d{6})")
pattern = re.compile("([BRV][EJ])?(\d{8}|\d{7}|\d{6})|$")
# filter to substitute illegal filenanme characters to " "
filter = re.compile('[\\\/:"*?<>|]+')

Expand Down

0 comments on commit 9837b1e

Please sign in to comment.