# RE for ending with b and having zero or multiple sets of aa and bb

## RE for ending with b and having zero or multiple pairs of aa and bb

Regular Expression = (aa+bb)*b

## RE for ending with b and having zero or multiple pairs of aa but no two b’s

Regular Expression = (aa)*b

## RE for ending with b and having one or multiple pairs of aa

Regular Expression  = (aa)+ b

## Rule

Regular Expression (RE) for ending with b and having zero or multiple sets of aa and bb must be accepted and all other strings must be rejected by our Regular Expression.

# Regular Expression = (aa)*(bb) * b

## Accepted Strings (part of the language)

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

• 3 strings of length 01 = {b,no more strings }
• 3 strings of length 02 = { no string exist}
• 3 strings of length 03= {aab, bbb, no more strings}
• 3 strings of length 04= { no string exist}
• 3 strings of length 05 = {aabbb, aaaab,bbbbb no more strings }
• 3 strings of length 06 = { no string exist }
• 3 strings of length 07 = {aaaaaab, aabbbbb, bbbbbbb, and many more similar strings }
• 3 strings of length 08= { no string exist}
• 3 strings of length 09 = {aaaaaabbb, aaaabbbbb, aaaaaaaab, and many more similar strings }
• 3 strings of length 10= { no string exist }
• Mmany more similar strings

Rejected Strings (not part of the language)

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

• 3 strings of length 01 = {a, no more strings}
• 3 strings of length 02 = {ab, bb, aa}
• 3 strings of length 03 = {aaa, bba, abb}
• 3 strings of length 04 = {aaab, bbbb, aabb}
• 3 strings of length 05= {abbbb, aaabb, aaaaa, and many more similar strings }
• 3 strings of length 06 = {aaaaab, aabbbb,bbbbbb, and many more similar  strings }
• 3 strings of length 07 = {aaaaaaa, abbbbbb, aaaaabb, and many more similar strings }
• 3 strings of length 08 = {aaaabbbb, bbbbbbbb, aabbbbbb, and many more similar strings }
• 3 strings of length 09 = {aaabbbbbb, abbbbbbbb,aaaaabbbb, and many more similar strings }
• 3 strings of length 10 = {aaaabbbbbb,aaabbbbbbb, aabbbbbbbb, and many more similar strings }

## 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.
Prof.Fazal Rehman Shamil (Available for Professional Discussions)
1. Message on Facebook page for discussions,