Hacker News new | ask | show | jobs
by Etheryte 1014 days ago
Wouldn't a simpler solution work here? Instead of trying to validate the filter regex, show some sample IP addresses or let the user insert a set of addresses, and then show which ones the filter matches and which ones it doesn't. Also helps address the problem of incorrect filters.
1 comments

The odds of the sample addresses matching is essentially zero, and adding work to the user is counterproductive.
I'm not sure I agree — most common regex editing tools available online include a section for adding test strings to verify what you actually wrote is correct. Clearly there is a benefit to it. In similar vein, allowing the user to test before they commit and then test actually reduces their work load, they don't have to drop and then reload the whole regex in their mind.
Sure, I use that when authoring and editing a RegEx. That's not the same as entry validation.