E.g. "asdoekrikkm", i want a regex that will match the "k" because it repeats in the string. I am trying to use string.match(regex) to do that, but i am not sure how to structure the regex.
You can use a capture group and a back reference:
const match = "asdoekrikkm".match(/(.)\1/)[1];
console.log(match);
(.) finds any character and stores it in a capture group. \1 is a back reference to the first character. (.)\1 searches for two same consecutive characters. .match returns an array with the full match (both consecutive characters) and the the capture group. "asdoekrikkm".match(/(.)\1/)[0] is the full match (two characters) and "asdoekrikkm".match(/(.)\1/)[1] is the capture group (one character).