IIRC SNOBOL2 had a similar construct. You got a string from the input data set, then ran various filter specs over it. the specs that ran over a given string could change based upon what previous filters found (or didn't find), and there were ways to save contexts and variables and such across the "cycles".
It's been about 35 years or so since I ran my last SNOBOL2 program, so I don't know how accurately I remember it, but...there you have it.