I am a linguistics and I start to read some books about Nlp. I have to design a non-deterministic automaton and regular expression over the alphabet $\{a,b,c\}$ that accept all and only those strings that contain exactly three a's, three b's, or three c's, not necessarily consecutively .for example; strings l.ike $\{aaa, abaab, abbcccccccccccbaaa,cbccbbbbbbb,..\}$ is accepted.
Thanks all
In regular expressions it would be:
(logical or with its versions with b and c, left as exercise for the reader)
https://regex101.com/r/mI5dM4/1
(Only the 3 a version, and include \b for word boundary)
It matches any (possibly empty) sequence of non-'a' characters, exactly 3 times interrupted by an 'a'.