I created a grammar which accepts all arithmetic expressions consisting of $+,-,*,/, (, )$.
I created the following grammar:
$S \rightarrow M+-M$
$+-M \rightarrow +M+-M$
$+-M \rightarrow -M+-M$
$+-M \rightarrow \epsilon $
$M \rightarrow E*/E$
$*/E \rightarrow *E*/E$
$*/E \rightarrow /E*/E$
$*/E \rightarrow \epsilon$
$E \rightarrow a$
$E \rightarrow (S)$
Where S is sum and our starting symbol, +,-,*,/,(,),a are terminal symbols and S,M, +-M, E, */E, () are nonterminals.
Now the question is, how do I prove that such grammar can't be regular?
(, )
and try to use the pumping lemma. $\endgroup$