I have a string of letters:
'AAACDDBBK'
I want to match only characters which only repeat once, so for instance: C
and K
. I know brackets {}
can be used to specify the number of matches you want, but that does not appear to be working for me.
str = 'AAACDDBBK'
regex = /[a-zA-Z]{1}/
str.match(regex)
>>>["A"]
How do I filter characters with more than one occurrence?