in reply to Replacing consecutive tokens in 1 pass

You can avoid consuming the trailing pipe with a lookahead:

s{ \| 9 [0-6] (?= \| ) # followed by another pipe }{|x}xg;

Hugo