I would like to find out if certain substrings exists in a string.
I have tried this:
x = "AAABBBCCC"
x.match(/(AAA|CCC)/)
However this resurns: Array [ "AAA", "AAA" ]
I would like to know exactly which substrings were present (e.g. Array [ "AAA", "CCC" ])
Is this possible?