You need to use a non-greedy multiplier:
s{ \|9 [0-6]+? # Here's the magic part \| } { |X| }xg
----
Reinvent a rounder wheel.
Note: All code is untested, unless otherwise stated
In reply to Re: Replacing consecutive tokens in 1 pass
by hardburn
in thread Replacing consecutive tokens in 1 pass
by aarestad
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |