<div id="box"></div>
function replacer(match, p1, p2, p3, offset, string) {
  console.log(match, p1, p2, p3, offset, string);
  return '{"alphabet":"' + p1 + p3 + '",' + '"number":' + p2 + '}';
}

let str = 'abc12345def';
let newstr = str.replace(/^(\D+)(\d+)(\D+)$/, replacer);

let box = document.getElementById('box');
box.innerHTML = newstr;

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.