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

Literals vs. Regular Expressions #8

Open
ScriptTiger opened this issue Mar 26, 2018 · 2 comments
Open

Literals vs. Regular Expressions #8

ScriptTiger opened this issue Mar 26, 2018 · 2 comments

Comments

@ScriptTiger
Copy link
Owner

When I first put this script together I wasn't sure what kind of user base I would be dealing with and I decided to go with literal expressions in the ignore file because you can just put the line exactly as it is that you want to ignore and you don't need any special characters and it makes it a bit easier for the less technically inclined. However, from what I have seen I think the users here are more than able to navigate the much more powerful regular expressions, but I'll be sure to include plenty of examples as needed to get those less technically inclined where they need to be to get the outcome that they want. This move will, however, break whatever ignore lists users currently have in place, so I just wanted to post this as an issue before implementing anything to get some feedback, give some warning, etc. The change itself would just be changing a single command, but the implications for the users are much greater. So let me know what you think and hopefully make me feel less guilty about going through with it.

A similar update script which already uses regular expressions is my DualServer updater:
https://github.com/ScriptTiger/DualServer
I went with regular expressions with DualServer because literals aren't as helpful in the DualServer format and being a DNS server it should be as configurable as possible.

You can google more info on regular expressions (RegEx), but here's a brief cheat sheet:

. Wildcard: any character
* Repeat: zero or more occurrences of previous character or class
^ Line position: beginning of line
$ Line position: end of line
[class] Character class: any one character in set
[^class] Inverse class: any one character not in set
[x-y] Range: any characters within the specified range
\x Escape: literal use of metacharacter x
<xyz Word position: beginning of word
xyz> Word position: end of word
@ScriptTiger
Copy link
Owner Author

I suppose a better solution might also be implementing an option for literals or RegEx and leaving the default as literals so nothing is broken during the update. I don't want my personal preference to blind my effectiveness at making this script accessible to as many people as possible.

@ohadschn
Copy link
Contributor

ohadschn commented Jan 3, 2020

I suppose a better solution might also be implementing an option for literals or RegEx and leaving the default as literals so nothing is broken during the update. I don't want my personal preference to blind my effectiveness at making this script accessible to as many people as possible.

Sounds good

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants