A regular grammar is a left or right regular grammar. Some textbooks and articles disallow empty production rules, and assume that the empty string is not present in languages.
Extended regular grammars
An extended right regular grammar is one in which all rules obey one of
A → w, where A is a non-terminal in N and w is in a string of terminals Σ*
A → wB, where A and B are in N and w is in Σ*.
Some authors call this type of grammar a right regular grammar and the type above a strictly right regular grammar. An extended left regular grammar is one in which all rules obey one of
A → w, where A is a non-terminal in N and w is in Σ*
A → Bw, where A and B are in N and w is in Σ*.
Examples
An example of a right regular grammar G with N =, Σ =, P consists of the following rules and S is the start symbol. This grammar describes the same language as the regular expression a*bc*, viz. the set of all strings consisting of arbitrarily many "a"s, followed by a single "b", followed by arbitrarily many "c"s. A somewhat longer but more explicit extended right regular grammar G for the same regular expression is given by N =, Σ =, where P consists of the following rules: ...where each uppercase letter corresponds to phrases starting at the next position in the regular expression. As an example from the area of programming languages, the set of all strings denoting a floating point number can be described by an extended right regular grammar G with N =, Σ =, where S is the start symbol, and P consists of the following rules:
Expressive power
There is a direct one-to-one correspondence between the rules of a right regular grammar and those of a nondeterministic finite automaton, such that the grammar generates exactly the language the automaton accepts. Hence, the right regular grammars generate exactly all regular languages. The left regular grammars describe the reverses of all such languages, that is, exactly the regular languages as well. Every strict right regular grammar is extended right regular, while every extended right regular grammar can be made strict by inserting new nonterminals, such that the result generates the same language; hence, extended right regular grammars generate the regular languages as well. Analogously, so do the extended left regular grammars. If empty productions are disallowed, only all regular languages that do not include the empty string can be generated. While regular grammars can only describe regular languages, the converse is not true: regular languages can also be described by non-regular grammars.
If mixing of left-regular and right-regular rules is allowed, we still have a linear grammar, but not necessarily a regular one. What is more, such a grammar need not generate a regular language: all linear grammars can be easily brought into this form, and hence, such grammars can generate exactly all linear languages, including nonregular ones. For instance, the grammar G with N =, Σ =, P with start symbol S and rules generates, the paradigmatic non-regular linear language.