Ruphaa's Notes

How to convert PascalCase/CamelCase to underscore_case in JS?

js
regex

str
.replace(/(?:^|\.?)([A-Z0-9])/g, function (x, y) {
return "*" + y.toLowerCase();
})
.replace(/^*/, "");