lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


I'd suggest

for word in string.gfind('ThisIsAnExample', '%u%l+') do
  -- do something with word
end

Not tested, i hope it works as you expect.

> Hi,
> 
> I'm trying to write a pattern that matches any string t
hat is a sequence of 
> initial caps words. eg ThisIsAnExample
> 
> This is for a toy wiki I'm constructing in lua. I curre
ntly have (%u%l+%u%l) 
> which matches TwoWord examples, but I cant work out how
 to repeat the 
> sequence. I had thought (%u%l+)
+ might work, but I'm not sure what that will 
> give.
> 
> I'd also like to know in a more general sense how to ma
tch repeated patterns 
> eg. how would I match any length sequence of numberUppe
rcaseLowercase
> 
> eg. 1Yl and 1Aa4Bb9Cc
> 
> thanks,
> 
> Rob
> 
> 



 
__________________________________________________________________________
Acabe com aquelas janelinhas que pulam na sua tela.
AntiPop-up UOL - É grátis!
http://antipopup.uol.com.br/