3 ms·
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 in
by saagarjha 3y ago
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.
- BoppreH 3y agoParser 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 https://en.wikipedia.org/wiki/Parser_combinator