in reply to my substitution problem:

Regexen problems? Well the rule is that it will work really really hard to find a match. So figure out why it is finding the unwanted match and deny it.

Well on the second substitution it is clearly able to match "0+" after a 1. Well does that fit the rule? Why yes, the preceeding "1" is not "^", so it can match What to do? Why deny it a digit there. That gives us:

s/(?<![\^\d])(?:\d+\+)//g; # ^^^^^^ <- was just \^ before
which does what you asked.

Replies are listed 'Best First'.
Re: Re (tilly) 1: my substitution problem:
by Madams (Pilgrim) on Feb 13, 2001 at 08:11 UTC
    Hey tilly!
    thanks (for the fix and the plural i LIKE regexen as a word), i think i was getting google eyed trying to figure that out.. i was relatively sure it involved my not specifying the negassert correctly but i just continually woofed it! regexen are one way to kill your eyesight ;)

    after a while they look like /{][P)(*^8(*(/ over and over :)
    p.s. still like the multfor "loop" you clued me in on (still studying it cause it's a cool hack!)

    Mucho gracias!
    madams.