Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

rename object keys using regexp

const result = data.map(datum => Object.assign(...Object
    .keys(datum)
    .map(key => ({ [key.replace(/[.|&;$%@%"<>+]/g, '')]: datum[key] }))
));
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #rename #object #keys #regexp
ADD COMMENT
Topic
Name
7+7 =