in reply to Re: Integrating match counts into regex matching
in thread Integrating match counts into regex matching

Phew, tilly -

This looks like a tricky one. Not sure I fully decipher it but I venture a transcript of your code here: "If the regex matches an 'a', decrease $count, if it matches a 'b', increase $count. Repeat as long as you can. When all the matching is done, check the value of $count. If it is '1' return the empty string, else return 'a'. Is this anywhere near the truth?

Also not sure what the \z does.

Thanks for your help though!

Cheers - Pat

Replies are listed 'Best First'.
Re^3: Integrating match counts into regex matching
by tilly (Archbishop) on Dec 19, 2008 at 00:06 UTC
    That is correct. The \z means end of string. It keeps you from matching things like "ben".

    But I misread your problem. I will match things like "bab" which is not according to your spec.