lua-users home
lua-l archive

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


Hello,

Brain freeze of the day… what would be a reasonable Lua string pattern to fold double vowels into one?

E.g.:

ao -> a
ii -> i
ue -> u

etc…

Got the following at the moment:

print( ( 'aaaa aaa aa a aaaaa' ):gsub( '([aeiou]?)([aeiou]?)', '%1' ))

> aa aa a a aaa

Is there a more straightforward way?

TIA.