Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use template string to replace regex #36

Open
nanozuki opened this issue Jul 19, 2021 · 8 comments
Open

Use template string to replace regex #36

nanozuki opened this issue Jul 19, 2021 · 8 comments
Assignees
Labels
enhancement New feature or request

Comments

@nanozuki
Copy link
Owner

Regular expression is too hard to write, use and debugging, even to exprienced developers!
So I want to use template string to configure episode to replace reguar expression.

episode = ひぐらしのなく頃に 業 EP{ep}.mp4

for more complex example:

episode = [dantalian字幕组][化物語][{ep}][1080p].mp4

for sp:

odd taxi SP{sp}.mkv
@nanozuki
Copy link
Owner Author

nanozuki commented Jul 19, 2021

@laxect
Do we need user to write whole name string, include extension name?
(or just filename or just substring)

@nanozuki nanozuki self-assigned this Jul 19, 2021
@exoticknight
Copy link

is ep or sp some sort of predefined syntax?

@nanozuki
Copy link
Owner Author

is ep or sp some sort of predefined syntax?

ep for episode number, sp for special episode number.

For example, episode = ひぐらしのなく頃に 業 EP{ep}.mp4 will match ひぐらしのなく頃に 業 EP01.mp4, ひぐらしのなく頃に 業 EP05.mp4.

@exoticknight
Copy link

is ep or sp some sort of predefined syntax?

ep for episode number, sp for special episode number.

For example, episode = ひぐらしのなく頃に 業 EP{ep}.mp4 will match ひぐらしのなく頃に 業 EP01.mp4, ひぐらしのなく頃に 業 EP05.mp4.

well then consider using episode instead of ep, special instead of sp?

@nanozuki
Copy link
Owner Author

well then consider using episode instead of ep, special instead of sp?

"ep" and "sp" is common abbr in this situation and already used in dantalian.

@laxect
Copy link
Collaborator

laxect commented Jul 19, 2021

What about support template without droping regex support?

@nanozuki
Copy link
Owner Author

What about support template without dropping regex support?

Considering backward compatibility, the support of regex will continue. I am thinking what is the priority if template string and regex are configured both? To report an error is also a choice in this case.

@laxect
Copy link
Collaborator

laxect commented Jul 21, 2021

What about support template without dropping regex support?

Considering backward compatibility, the support of regex will continue. I am thinking what is the priority if template string and regex are configured both? To report an error is also a choice in this case.

Just use regex and print a warn?

@laxect laxect added the enhancement New feature or request label Oct 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants