# A regular expression for string having must 010 or 101

A regular expression for string having must 010 or 101.

## Finite automata for strings must have 010 or 101 in the language

ACCEPTABLE STRINGS(PART OF THIS LANGUAGE)

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

• strings of length 1 = no string exist.
• strings of length 2 = no string exist
• strings of length 3 = {101, 010,no more string}
• strings of length  4 = { 0101, 1011, 0100,…and many more similar strings}
• Strings  of  length 5 = {10101, 11011, 01010,…and many more similar strings}
• Strings  of length  7= {1010110, 1101011, 1101110,…and many more similar strings}
• Strings  of length  10 ={0000101011, 1000101001, 1101011011,…and many more similar strings}
• Strings  of length  15 = {00001010100001, 011110100010001, 110101101100100,…and many more similar strings}
• Strings  of length 20 = {0000101010000111000, 0111010001000100111, 11010110110010011100,…and many more similar strings}
• 3 string of length 25 ={000010101000011100011011, 011101000100010011100011, 1101011011001001110011010,…and many more similar strings}
• and 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.

• Strings  of length 1={1 ,0, no more string}
•  Strings  of length 2 = {00,11,10, 01}
• Strings  of lenth  5 ={11100,00000,01100,…and many more similar strings}
• Strings  of length 7 ={1111000, 1100011, 0000111,…and many more similar strings}
• Strings  og length  10 ={1111000111, 1110000111, 0000111100,…and many more similar strings}
• Strings   of  length 25={00001111111000011111, 1110000111100001110000000, 00001111110000011110000000,…and many more similar strings}
• and many more similar strings

Regular expression for string having must aba or bab

## Regular expression : (a+b)*(aba+bab)(a+b)*

ACCEPTABLE STRINGS(PART OF THIS LANGUAGE)

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

• strings of length 1 = no string exist.
• strings of length 2 = no string exist
• strings of length 3 = {bab, aba,no more string}
• strings of length  4 = { abab, babb, abaa,…and many more similar strings}
• Strings  of  length 5 = {babab, bbabb, ababa,…and many more similar strings}
• Strings  of length  7= {bababba, bbababb, bbabbba,…and many more similar strings}
• Strings  of length  10 ={aaaabababb, baaababaab, bbababbabb,…and many more similar strings}
• Strings  of length  15 = {aaaabababaaaab, abbbbabaaabaaab, bbababbabbaabaa,…and many more similar strings}
• Strings  of length 20 = {aaaabababaaaabbbaaa, abbbabaaabaaabaabbb, bbababbabbaabaabbbaa,…and many more similar strings}
• 3 string of length 25 ={aaaabababaaaabbbaaabbabb, abbbabaaabaaabaabbbaaabb, bbababbabbaabaabbbaabbaba,…and many more similar strings}
• and 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.

• Strings  of length 1={b ,a, no more string}
• Strings  of length 2 = {aa,bb,ba, ab}
• Strings  of lenth  5 ={bbbaa,aaaaa,abbaa,…and many more similar strings}
• Strings  of length 7 ={bbbbaaa, bbaaabb, aaaabbb,…and many more similar strings}
• Strings  og length  10 ={bbbbaaabbb, bbbaaaabbb, aaaabbbbaa,…and many more similar strings}
• Strings   of  length 25={aaaabbbbbbbaaaabbbbb, bbbaaaabbbbaaaabbbaaaaaaa, aaaabbbbbbaaaaabbbbaaaaaaa,…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.