Build, test, and debug regular expressions
This regex matches lines over the alphabet {a, b, c} meeting one of two conditions from a formal language exercise: either the string contains at least two 'a' characters (first alternative allows any mix of a/b/c around two or more a's), or it contains exactly three 'b' characters (second alternative restricts everything else to a/c so a fourth b is impossible). With the gm flags, each line of multiline input is tested independently, making it useful for validating strings in automata theory homework or test-case generation.