Node.js examples for Regular expression:Match
Convert a string to camel case notation with regex
/**/*ww w.j ava 2 s .co m*/ * Convert a string to camel case notation. * @param {String} str String to be converted. * @return {String} String in camel case notation. */ exports.camelCase = function(str) { return str.replace(/[_.-](\w|$)/g, function(_, x) { return x.toUpperCase(); }); };