Skip to content

Literals vs. Regular Expressions #8

@ScriptTiger

Description

@ScriptTiger

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

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions