Re:Regex Engine Internals as a Library
by saagarjha on Wednesday July 05, 2023 @12:07PM
(#36602426)
You're going to have to define some sort of API for matching on a sliding window of values. This isn't impossible, but most languages don't really have great interfaces for it.
[ Parent
| on HN ]
Parser combinators[1] seem perfectly suited for this.
# A sequence of 5 or more failed login attempts followed by a successful one.
obj_regex.search(repeat(is_failed, min=5)+is_success, my_list)
[1]: https://en.wikipedia.org/wiki/Parser_combinator