Hi,
I'm looking for an elegant way to convert class names with optional
namespace prefixes to names for custom html elements.
MYCustomElement and CustomElement
to
and
There must be an elegant way to do it with regex or inject, but I'm
embarrassed to say I can't get my head around it. I can ge
My feeling is that it cannot be solved by regular expressions. The reason it
that there is the regular expressions in smalltalk/pharo does not have
look-ahead or backtracking. In your example the capital Y is part of MY, but C
starts a new word. I do not know of anyway to express that in smallta
I took this a my afternoon code-quiz, so here is a solution if you want it:
splitCamelCase
| str split word|
"Split an expanded camelcase word into constituents. Extened camel case
allow some words to be fully uppercase"
"'ZAPMeToo' splitCamelCase >>> #('ZAP' 'Me' 'Too')"