I would imagine this is a multiple part situation with regex, but how would you split a camelcase string at the capital letters turning them in to lowercase letters, and the
Try the following:
var token = document.getElementsByTagName('strong')[0].innerHTML,
replaced = token.replace(/[a-z][A-Z]/g, function(str, offset) {
return str[0] + '-' + str[1].toLowerCase();
});
alert(replaced);
Example - http://jsfiddle.net/7DV6A/2/
Documentation for the string replace function:
https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/String/replace