Lets say I want to make a balanced capture between the occurrence of an uppercase an a lowercase letter.
words = "I WANT 9()?!., CHOCOLATE milk!"
using the balanced capture, %bxy, how would I match a pattern to correspond to the the the first occurrence of an uppercase letter, followed by a lowercase letter and everything inbetween?
My ideal solution does not work
for match in string.gmatch(words, "%b%u%l") do print (match) wait(.1) end
I believe the pattern you're looking for is "%u%L*%l". That's one upper case letter followed by non-lowercase letters followed by a single lower case letter.
(I don't think "balanced captures" have anything to do with it.)