in reply to Real global substitution, what's the best way?

Use ((:?b\d+)+) to match a sequence.

The (b\d+) you have will only match a single occurance.

Replies are listed 'Best First'.
Re: Re: Real global substitution, what's the best way?
by mirod (Canon) on Dec 08, 2001 at 00:50 UTC

    I can only match one occurence at a time, because I need to process each of them separately : want to wrap each one, separately, in (), so matching them all would force me to then include a some processing on the right side of the substitution, which is possible, but, I think, not as easy to write as what I have right now. It could be slightly faster though, although it is not really important in my software.

    I admit it the example looks quite contrived but it really makes sense in the real code!