3 ms·
Ask HN: Hide by Regex Pattern?
Would it be expensive/difficult to implement hiding by pattern?
Say, an account can have up to some reasonable number of patterns.
In the profile, they could appear in a simple multi-line text field. Any nonblank line is a pattern. A checkbox next to this controls whether it is turned on and off.
Any title matching any of the patterns is hidden. If a pattern starts with url: it applies to the URL domain rather than title. Remove a pattern and everything that is only hidden by that pattern is unhidden.
Disable pattern hiding by clearing the checkbox, and everything hidden by patterns appears.
- brudgers 4y agoIf you really want this, it is probably better to just write a Tampermonkey script for yourself because I suspect it is unlikely to be implemented as an HN feature in the next ten years. I mean there are no user facing features of similar complexity and no features with that level of UI on HN.
- kazinator 4y agoDid you notice the | hide } link on stories? HN somehow associates your account with a list of submission IDs that hit hides. In the same way, some patterns associated with the account could be checked. "Does one of the entries in the user's hidden list match this story's ID" is not far off from "does one of the user's hide-patterns match this story's title or domain?"
- brudgers 4y agoYes, I use hide sometimes, particularly after Apple releases a new product. In keeping with what I imagine to be a YC philosophy, it is a simple thing that might work. In keeping with what I imagine is the site's implementation, it is a list. In keeping with HN's culture, it has limited disruption to everyone-sees-the-same-thing. I could be wrong, but custom user regex's doesn't seem to fit with these. There's also the additional processing load for running regex's on the server and the DOS surface area that would add... But you might argue the regex could be implemented on the client using javascript. And that would put us in total agreement.