lua-users home
lua-l archive

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



On 14 Jan '06, at 4:53 AM, PA wrote:

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


I don't, but I can suggest looking at the source code to various wiki markup engines, since they all have to detect (if not split) CamelCase, and they probably use regexps to do it, which would probably port well to Lua patterns. 

IIRC, Instiki <http://instiki.org> does split apart the words in a page title, so that might be the best place to start. (E.g., if there is a page called "componentWithURL", when you view that page the title will show as "component With URL".) Plus, Instiki is written in Ruby, which is sort of a cousin of Lua so the source should be more readable than, say, Perl :)

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

Interesting! Thanks for pointing that out; it's useful. Somewhat like the usual regexp "\b" but more general-purpose. If it's supported, could it please be added to the 5.1 reference manual?

--Jens