in reply to Replacing consecutive tokens in 1 pass

You can use a positive lookahead, which will check for a | character (or the end of the line) after the match, but will not "consume" it. Something like this:
s/\|9[0-6](?=\||$)/|X/g

-- Mike

--
just,my${.02}