Open Zweibach opened 4 years ago
Regex can be used to extract data from a string but not the reverse(for weird technical reasons I'm not going to get into). But if you've ever tried to use a password cracker on a archive or something you'll know that everyone tries to reinvent the syntax for actually generating key sequences. I would recommend either a very limited syntax, or just a set of possible keys to test for. I expect for this particular application that would not be to onerous.
The point of the request was to be able to just make a single URL class that catches both cases rather than one for q and one for sbq, not adding them to the string or whatever else you've got going on in your head.
Regex defined keys in parser. Example, derpibooru uses both
q
andsbq
as query key, defining this asq|sbq
would make both work.