All strings over a b c that contain exactly two csSolutionab
All strings over {a, b, c} that contain exactly two c’s.
Solution
(?:[ab]*c[ab]*c[ab]*)+?
[ab]* — String matches the zero or unlimited times, the string look like this (ababab, bababa, aabbaaa, etc).
c[ab]* - String matches the zero or unlimited times with one \"c\", the string look like this (cababa, cbababa, cbbbaaa, etc).
+? Quantifier — Matches between one and unlimited times the string matches. like (ccab, abcc, cabc, ababababcc, cac, abcccc, abcabc, etc.)
![All strings over {a, b, c} that contain exactly two c’s.Solution(?:[ab]*c[ab]*c[ab]*)+? [ab]* — String matches the zero or unlimited times, the string look like All strings over {a, b, c} that contain exactly two c’s.Solution(?:[ab]*c[ab]*c[ab]*)+? [ab]* — String matches the zero or unlimited times, the string look like](/WebImages/33/all-strings-over-a-b-c-that-contain-exactly-two-cssolutionab-1098307-1761579702-0.webp)