lua-users home
lua-l archive

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


Does anyone have a simple pattern to split camel case strings?

For example:

"componentWithName" -> { "component", "With", "Name" }

Here is what I have presently:

( "componentWithName" ):gsub( "%u?%l+", print )

> component
> With
> Name

However this doesn't quite cover all potential cases, specially acronyms (e.g. "componentWithURL"): showComments=true&entry=3271976088

Also, is the "frontier pattern" aka "%f" something which is officially supported? It doesn't seem to be documented anywhere beside this wiki page:



PA, Onnay Equitursay