Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 4

Lecture 10

Theory RE Containing Substring


• Regular Expression
of for language with
Automata Substring
• 5 Important
Questions
Lecture 10: Regular Expression for a language with Substring, examples alisoomro666@gmail.com

It is one of the language defining methods by which language is Substring?


represented in terms of strings (Power, Concatenation, Union) aabababa
Smaller
L={^, a,aa,aaa,aaaa,………...} chotaa
R = a*
R = a+ L={a,aa,aaa,aaaa,aaaaa,…..} Q: Define a RE for language that contains the substring ba
(a+b)* ba (a+b)*
R= ab* L= {a, ab, abb, abbb,abbbb}
R=a+b L={a,b} Power
Fixed Power: 2
R=(a+b)* L={^,a,b,aa,ab,ba,bb,aaa,aab,..} ba b = baab
Kleene star(Can contain null): ba*b = bb or bab or baab or baaaaaaab
R = a(a+b)*a L={aa,aaa,aba,aaaa,aaba,…} Kleene plus(Can’t contain null): ba+ b = bab or baab or baaaaaaab

Q: All strings which do not contain the Concatenation ( AND )


substring ba. A.B
AB

b*a* a*b* Union ( OR )


A+B
A|B
Lecture 10: Regular Expression for a language with Substring, examples alisoomro666@gmail.com
Q: Define a RE for language that contains the substring 00

(0+1)* 00 (0+1)*

Q: All strings which do not contain the substring 00.

0 + 1* + 1* 0 1*

Q: All strings which do not contain the substring 101.

0* ( 1*000*) * 1* 0*
Theory
of Thank you 
Subscribe
Automata
By: Ali Hassan Soomro
BSCS from UBIT, University of Karachi
DAE in Electronics from SBTE
Facebook: www.facebook.com/AliiHassanSoomro
Gmail: alisoomro666@gmail.com

You might also like