

















































Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!


















































Regular Expressions
Examples A regular expression: a b c * ( c Æ) Not a regular expression:^ ^ a ^ b
Languages of Regular Expressions : language of regular expression Example L r r L ( a b c )* , a , bc , aa , abc , bca ,...
Definition (continued) For regular expressions 1 and r 2 r 1 2 1 2 L r r L r L r 1 2 1 2 L r r L r L r * * 1 1 L r L r 1 1 L r L r
Example Regular expression: a b a * L a b a * L a b L a * L a b L a * L a L b L a * a b a * a , b , a , aa , aaa ,... a , aa , aaa ,..., b , ba , baa ,...
Example Regular expression r^ ^ aa ^ *^ bb ^ * b { : , 0 } 2 2 L r a b b n m n m
Example: what is the regular Expression? r ( 0 1 )* 00 ( 0 1 ) * L ( r )= { all strings with at least two consecutive 0 } Every string in L(r) must contains 00 somewhere, but what comes before or what comes after is completely arbitrary.
Example Cont.
Equivalent Regular Expressions Definition: Regular expressions and are equivalent if 1 r 2 r ( ) ( ) 1 2 L r L r
Theorem Languages Generated by Regular Expressions Regular Languages
Theorem - Part 2 Languages Generated by Regular Expressions Regular Languages L r L^ ( r ) L
Proof - Part 1 r L ( r )