I'm trying to make a regular grammar for this language:
$$ L = \{ a^ncb^m(cc)^p : n\ge 1, m\le 1, p\ge 0\} $$
Where the alphabet is $ \Sigma = \{a,b,c\}$
It seemed like right-linear. This may be disastrously wrong, but here's how I started:
$S \to aA$
$A \to aA | cB $
$B \to bC | C $
$C \to cD |$ $\lambda$
$D \to cC$
EDIT: Corrected for the errors pointed out.
You’ve a couple of problems right off the bat: your grammar can generate at most one $a$, and it can generate the word $a$, which isn’t in $L$. You can solve both of these problems by replacing $A\to cB\mid\lambda$ with $A\to aA\mid cB$: with those and the initial production $S\to aA$ you can generate all strings of the form $a^ncB$ with $n\ge 1$.
You’re in trouble again with the $B$ productions: $B\to bB$ allows you to generate as long a string of $b$’s as you like, when you’re supposed to generate at most one $b$. You needed something like this for the $a$’s; you don’t want it for the $b$’s. You don’t need the $\lambda$ production, either: you can take care of that at the $C$ stage. What you need here is $B\to bC\mid C$: generate at most one $b$ and shift to generating $cc$’s. $C\to ccC\mid\lambda$ is then fine, provided that your definition of regular grammar is what many refer to as an extended regular grammar. This is a right linear grammar, but note that right linearity is a property of the grammar, not of the language.
If you’re required to use a regular grammar in the strict sense of the term, you need to replace $C\to ccC$ with regular productions, e.g., $C\to cD\mid\lambda$ and $D\to cC$. (Note that you do not want a $\lambda$ production for $D$, since you don’t want to stop with an odd number of final $c$’s.)