Categories of Regular Expressions

 

Category 1: Basic Regular Expressions

Sr.Regular ExpressionExplanation
1aOnly a single character "a".
2abSequence "a" followed by "b".
3(a+b)Either "a" or "b".
4(a)*Zero (ε) or more occurrences of "a".
5(ab)*Zero (ε) or more repetitions of the sequence “ab".
6(a+b)*Zero (ε) or more symbols from the alphabet {a,b} of any length, any order.
7(a)+One or more occurrences of "a".
8(ab)+One or more repetitions of the sequence "ab".
9(a+b)+One or more symbols chosen from "a" or "b".
10(10+1)*Zero (ε) or more repetitions of "10" or "1".
11(01+10+1)*Zero (ε) or more repetitions of "01""10", or "1".
12(a+b+c+d)*Zero (ε) or more symbols chosen from "a""b""c", or "d".
13(a+b+c+d)+One or more symbols chosen from "a""b""c", or "d".
14(ab+bb+cc+dd)*Zero (ε) or more repetitions of "ab""bb""cc", or "dd".
15101 + (0+1)*1Either "101" or any combination of 0s and "1s” ending in "1".
1611 + 00 + 0 + 10*Either "11""00", a single "0", or "1" followed by zero or more "0s”.
171(0 + 11) + 0(00 + 1)Either "1" followed by "0" or "11", or "0" followed by "00" or "1".
18ba + (aa + b)*Either "ba" or any number of repetitions of "aa" or "b".
19aa + ba + (aa + b)*Either "aa""ba", or any number of repetitions of "aa" or "b".
20(00)*(0 + 1) + (1)*Zero (ε) or more "00"s followed by 0 or 1, or any number of "1s”.
21(001)* + (00)Zero (ε) or more repetitions of "001", or exactly "00".

Category 2: Start with Regular Expressions

r.Regular ExpressionSimple Explanation
1a(a+b)*Starts with a, followed by any number (even zero) of as or bs in any order.
2101*(0+1)*Starts with 10, then zero or more repeats of 1, then zero or more mix of 0s and 1s.
3bab(a+b)*Starts with bab, followed by zero or any number of as or bs .
4aa(aba+bab)*Starts with aa, followed by zero or any number of the patterns aba or bab.
5(a(bb)*)(a+b)*Starts with a, then zero or more bbs, then zero or any number of as or bs in any order.
61(0+1)(00+11)*Starts with 1, then either 0 or 1, then zero or more repeats of 00 or 11.
7a+b+c(ab+bb+cc)*One"a", One “b”, or starts with"cand then zero or more repeats of abbb, or cc patterns.
8a+b+c+d(ab+bb+cc+dd)*One"a", One “b”, One “c” or starts with"dand then zero or more repeats of abbb, cc, or dd patterns.
9aba(a+b)* + bab(a+b)*Either starts with aba or bab, followed by zero or any number of as or bs

Category 3: End with Regular Expressions

Sr.Regular ExpressionSimple Explanation
1(a+b+c+d)*abAny mix of abcd (including empty), ending with ab.
2(aaa+bbb)*baRepeats of aaa or bbb (or none), ending with ba.
3(a+b+c)*abcAny mix of ab, or c (including empty), ending with abc.
4(0+1)*101*Any mix of 0s and 1s, followed by 10, and then any number of 1’s.
5(a+b)*a(a+b)bAny mix of a and b, then an aa or ab,and ending with b.
6(00+11)*1(0+1)Repeats of 00 or 11 (or none), followed by 1, and then either 0 or 1

Category 4: Start and End with Regular Expressions

Sr.Regular ExpressionSimple Explanation
11(1+0)*1 + 0(1+0)*0Strings that start and end with 1 or start and end with 0, and mix of 0, 1 in between
211(0+1)(00)Starts with 11, then either 0 or 1, and ends with 00.
300(11)*101Starts with 00, followed by any number of 11's, and ends with 101.
4aba(aa+b)*baStarts with aba, followed by any number of aa or b, and ends with ba.
5b*(aaa+bbb)*baAny number of bs, followed by any number of aaa or bbb, and ending with ba.
6a(a+b)*ba + aEither just a, or starts with a, followed by any mix of as and bs, and ends with ba.
70 + 1(0+1)*10Either a single 0, or a string starting with 1, then anything over 0,1, and ending with 10.
8(11)*(0+1)(00)Repeats of 11, followed by either 0 or 1, and ending with 00.
9(1)*(0+1)*(00)*Any number of 1s, followed by any combination of 0s and 1s, followed by any number of 00s.
1010(101+0+1)*1Starts with 10, followed by any number of 1010, or 1, and ends with 1.
11ac(a+b+c)*baStarts with ac, then any mix of ab, or c, and ends with ba.
12d(a+b+c)*badStarts with d, then any mix of ab, or c, and ends with bad.
13acd(a+b+c)*badStarts with acd, then any mix of ab, or c, and ends with bad.
14    bb(a+b)*aa(aa+bb)Starts with bb, followed by any mix of as and bs, then aa, and ends with either aa or bb.
15           (aa+bb)((aa)*+b)*baStarts with aa or bb, followed by any number of aas or bs, and ends with ba.

Comments

Popular posts from this blog

Theory Of Computation PCCST302 KTU Semester 3 BTech 2024 Scheme

Non deterministic Finite Automata NFA

Example DFAs University Questions