# Regular expression for Even Length Strings defined over {a,b}

## Regular expression for Even Length Strings defined over {a,b}

Rule

All strings having even length strings must be accepted and all other strings must be rejected by our Regular Expression.

Regular expression=(aa+ab+ba+bb)*

## DFA for Regular expression of (aa+ab+ba+bb)*

ACCEPTABLE STRINGS(PART OF THIS LANGUAGE)

These strings are part of the given language and must be accepted by our Regular Expression.

• 3 strings of length 1 = no string exist.
• 4 strings of length 2 = {aa , ab , ba ,bb }
• 3 strings of length 3 = no string exist .
• 3 strings of length 4 = { aaba , aaaa , aabb, and many more similar strings}
• 3 strings of length 5 = no string exist.
• 3 strings of length 7= no string exist.
• 3 strings of length 10 ={aaaaababba,aaabbabbaa,babbaaabbb,bbaababbaa, and many more similar strings }
• 3 strings of length 15 = no string exist.
• 3 strings of length 20 = {aaaaaaababbababbbbaa,bababaabbaaaaabbabab,abababababbabaaaaaaa,bbbbbbbbaaaaaaaaabab,babababaabababababbb, and many more similar strings }
• 3 string of length 25 =no string exist.
• Many more similar strings

Unacceptable strings(not part of this language)

These strings are not part of the given language and must be rejected by our Regular Expression.

• 3 strings of length 1={a,b, and many more similar strings }
• 3 strings of length 3 = {aaa,bbb, and many more similar strings }
• 3 strings of lenth 5 ={aaaaa,bbbbb,aaaba, and many more similar strings }
• 3 strings of length 7 ={aaaaaaa,bbbbbbb,aaaaaab, and many more similar strings }
• 3 strings of length 15 ={aaaaaaaaaaaaaaa,ababaababababba,bbbbbbbbbbbbbb,babababababaaab, and many more similar strings }
• 3 strings of  length 25={aaaaaaaaaaaaaaaaaaaaaaa,bbbbbbbbbbbbbbbbbbbbb,aaaaaabababababababababab, and many more similar strings }
• Many more similar strings.

Regular expression for Even Length Strings defined over {a,b}

## Tutorial: Regular Expression

A detailed tutorial of the regular expression is here in the link of regular expression tutorial. This page contains the practice questions of regular expressions with solutions.

Tutorial covering the topics

• Give a regular expression.
• Describe the strings of the regular expression.
• write a regular expression.
• create all strings from regular expression.
• Generate all strings from regular expression.
• Extract all strings from regular expression.
• Find all strings from regular expression.
• Examples of regular expression.