You need a zero-width positive look-ahead assertion.
s{\|9[0-6](?=\|)}{|X}g;
The (?=\|) tells the regex engine to look for (but not act upon) the vertical bar.
In reply to Re: Replacing consecutive tokens in 1 pass
by Mr. Muskrat
in thread Replacing consecutive tokens in 1 pass
by aarestad
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |