Paricular user's case:
We have a program, that produces a log file. When this program starts, it writes START into that log, when it finishes - FINISH. We need a trigger, that would trigger, if withing 5 minutes after START there is no FINISH.
Currently we do not have any trigger function, that would help us to determine, which text is the last in the log - START or FINISH.
A new proposed function could be simular to already existing "count" function. It should return how many values ago was the last value that matches a given regex. It returns sequence number from history's end - it will be different on each trigger calculation.
This way we can compare two such functions in a trigger expression and find out, which was the last - START of FINISH.