in reply to regexp Non-capturing Grouping failure

My apologies, I had spent some time trying to figure this out, and then within 5 minutes of posting I worked out that the pipe character needs escaping.
That snippet should now be (?:\|([^]]+))?

Replies are listed 'Best First'.
Re^2: regexp Non-capturing Grouping failure
by herveus (Prior) on Sep 01, 2004 at 10:54 UTC
    Howdy!

    ...nothing like explaining it to someone else/blank wall/whatever to bring that flat-forehead moment!

    Been there. Done that.

    yours,
    Michael
Re^2: regexp Non-capturing Grouping failure
by Crian (Curate) on Sep 01, 2004 at 10:17 UTC
    Yes, because the pipe character stands for alternatives.