I took it from a snippet I suggested elsewhere, to avoid doing both `key.substr(0, 5)` and `key.substr(5)`:

> ```javascript
> var match = /^data-(.*)$/.exec(key);
> if (match) {
>   elem.data[match[1]] = elem.attribs[key];
> }
> ```