Regex engine internals as a library
Can this be used for non-string lists? I always found it frustrating that we have this amazing machinery for searching and modifying lists of <i>characters</i>, but as soon as I have a list of <i>numbers</i> or <i>dates</i> it all goes out of the window.<p>Let&#x27;s say I have a list of login attempt dates, and I want all sequences of 5+ failed login attempts followed by a success. With a regex it&#x27;s trivial, but I can&#x27;t use that; I have to roll my own loop, flags, and temporary lists.<p>Sure, I could convert my list to a string, process it, and (try to) convert it back, but the downsides are obvious.<p>Even if the performance is not as good as string-based regex, why shouldn&#x27;t we have regexes for arbitrary list types?<p>---<p>Edit: I realized this is not the first time I had this idea, and found an old Python prototype: <a href="https:&#x2F;&#x2F;github.com&#x2F;boppreh&#x2F;listregex">https:&#x2F;&#x2F;github.com&#x2F;boppreh&#x2F;listregex</a><p>It&#x27;s horribly slow, but as an API experiment I&#x27;m quite happy. It also gives some tools not available to regexes, like inverting and intersect patterns, and matched pairs.