Weird valid regex
Opened this issue · 2 comments
Moon-0xff commented
If user inputs to label-filtered-list
entry something like ,,,,,,,,,,,,,
is converted to |||||||||||||||
and used as a regex in the line:
const filterRegex = new RegExp("(?:-|\\(|\\[).*(?:" + sanitizedInput.replace(",","|") + ").*(?:$|\\)|\\])","gi");
This is a valid regex, and acts as global wildcard, which is the behaviour I expected, but surely looks like a problematic regex.
abisammy commented
Was thinking about this...
Might be better to implement filters in a better way, for example a more "todo list" style such as:
https://www.w3schools.com/howto/howto_js_todolist.asp
I'm pretty sure in gnome js, settings can be stored as arrays, so the blacklist can be stored as an array, additionaly the todo list would make it more user friendly.
This removes the annoyances of having a regex, and will fix this bug.