in reply to Re: Double regex match not working correctly.
in thread Double regex match not working correctly.

Thanks Masem and all.

I thought of doing it that way first, but in my mind I didn't think it would work because I thought something like this would happen...

string after first - <B>bar</B> there is a <B><B>foo</B> <B>bar</B></B +> and a <B><B>bar</B> <B>foo</B></B> and also <B>foo</B> and <B>bar</ +B>.
See how the multiple words also matches for the single words and now we have compounded <B> tags. That's what I thought would have happened. Since I was using the g modifier I would think the regex would go through and transform the multiple word matches and then go through and match the single words also, which would not be good. But now I see that it would have worked. Next time I'll try my first instinct.

Thanks to all that posted.