Skip to main content
replaced http://mathematica.stackexchange.com/ with https://mathematica.stackexchange.com/
Source Link
starSet = {"A", "B", "C"};
StringCount["ABAACAWABCAA", Repeated[starSet, {5}], 
            Overlaps -> False]
2

Edit:

Alternatives is redundant, see the comment of Sjoerd C. de VriesSjoerd C. de Vries below. Thanks ;)

starSet = {"A", "B", "C"};
StringCount["ABAACAWABCAA", Repeated[starSet, {5}], 
            Overlaps -> False]
2

Edit:

Alternatives is redundant, see the comment of Sjoerd C. de Vries below. Thanks ;)

starSet = {"A", "B", "C"};
StringCount["ABAACAWABCAA", Repeated[starSet, {5}], 
            Overlaps -> False]
2

Edit:

Alternatives is redundant, see the comment of Sjoerd C. de Vries below. Thanks ;)

added 165 characters in body
Source Link
Kuba
  • 137.7k
  • 13
  • 289
  • 751
starSet = {"A", "B", "C"};
StringCount["ABAACAWABCAA", Repeated[Alternatives @@ starSetRepeated[starSet, {5}], 
            Overlaps -> False]
2

Edit:

Alternatives is redundant, see the comment of Sjoerd C. de Vries below. Thanks ;)

starSet = {"A", "B", "C"};
StringCount["ABAACAWABCAA", Repeated[Alternatives @@ starSet, {5}], 
            Overlaps -> False]
2
starSet = {"A", "B", "C"};
StringCount["ABAACAWABCAA", Repeated[starSet, {5}], 
            Overlaps -> False]
2

Edit:

Alternatives is redundant, see the comment of Sjoerd C. de Vries below. Thanks ;)

Source Link
Kuba
  • 137.7k
  • 13
  • 289
  • 751

starSet = {"A", "B", "C"};
StringCount["ABAACAWABCAA", Repeated[Alternatives @@ starSet, {5}], 
            Overlaps -> False]
2