I\'m stuck with the following problem:
I need to find repeated characters in a string.
Basically what I want is regular expression that will match like that
let myString = 'abababc';
let result = {};
for (let str of myString) {
result[str] = result.hasOwnProperty(str) ? result[str] + 1 : 1;
}
console.log(result);