Regular Expression for language I have a grammer with the following productions,
S -&gt; aA | bC | b
A -&gt; aS | bB
B -&gt; aC | bA | a
C -&gt; aB | bS

I have to construct regular expression for it. I derived words for this language and which are

b, aab, aba, baa, bbb, aaaab, aaaba, aabbb, abaaa, baaaa, ...

So after I deriving the words I concluded that it's a language of strings having odd number of b and having odd length.
Can you please help me to construct regular expression for it.
I appreciate your help.
Note that your grammar is regular. Quoting from wikipedia:

A grammar is regular when no rule has more than one nonterminal in its right-hand side, and each of these nonterminals is at the same end of the right-hand side.
Every regular grammar corresponds directly to a nondeterministic finite automaton, so we know that this is a regular language.

In theory, every regular grammar generates a regular language. Also, its not hard to construct the relevant NFA for the generated language: for a specific example on how to do that, you can click here (this is actually what has been done in @Matthieu Latapy's answer). Once you have an NFA for the language, you can translate it into a regular expression (there are several ways to achieve this based on state removal methods which are a bit tedious: see here).
BTW, you already know that your language is all words with &quot;odd length and odd number of b's&quot;. It is easy to build a DFA for it consisting of 4 states (hint: your language is an intersection of two languages, each having a DFA with two states).