I cannot understand what it is you're trying to accomplish. What are you trying to use \G for? Could you explain your input and output formats better?
One mistake I can see, though, is that you have {,$min} as a quantifier. That's not a valid quantifier: you need a leading 0 in there. {0,$min}.
Oh, another mistake: \b is only a word boundary outside of a character class. Inside a character class, it matches a backspace.
_____________________________________________________
Jeff
japhy Pinyan,
P.L., P.M., P.O.D, X.S.:
Perl,
regex,
and
perl
hacker
How can we ever be the sold short or the cheated, we who for every service have long ago been overpaid? ~~ Meister Eckhart