I need to combine any character that repeats twice, for example:
"abccdeff"
Must match "cc" and "ff". In any other regex syntax, let me use Javascript as a quick example, I could do:
var str = "abccdeff";
var r = /([a-z]{1})\1/g
console.log(str.match(r))
What returns
[ 'cc', 'ff' ]
But Regexp Go does not seem to allow this. Is it possible to do this in Go?
source
share