Could these patterns be matched by regular expression or context free grammar? <p>This is an exercise of compiler. We are asked if it's possible to match the following patterns with regular expression or context free grammar:</p> <ol> <li>n 'a' followed by n 'b', like 'aabb'</li> <li>palindrome, like 'abbccbba'</li> <li>n 'a', then n 'b', then n 'c', like 'aabbcc'</li> </ol> <p>Note that n could be any positive integer. (Otherwise it's too simple)</p> <p>Only 3 character 'abc' could appear in the text to parse.</p> <p>I'm confused because as far as I can see, non of these patterns can be described by regular expression and context free grammar.</p>