




























































































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
Gul Agha Mahesh Viswanathan
University of Illinois, Urbana-Champaign
Fall 2010
Regular Expressions
Recall: A language is a set of strings
Regular Expressions
Recall: A language is a set of strings We can consider new languages derived from operations on given languages e.g., L 1 ∪ L 2 ,
Regular Expressions
Recall: A language is a set of strings We can consider new languages derived from operations on given languages e.g., L 1 ∪ L 2 , L 1 ∩ L 2 ,
Regular Expressions
Recall: A language is a set of strings We can consider new languages derived from operations on given languages e.g., L 1 ∪ L 2 , L 1 ∩ L 2 , 12 L,... A simple but powerful collection of operations:
Regular Expressions
Recall: A language is a set of strings We can consider new languages derived from operations on given languages e.g., L 1 ∪ L 2 , L 1 ∩ L 2 , 12 L,... A simple but powerful collection of operations: Union, Concatenation and Kleene Closure
Regular Expressions
Definition Given languages L 1 and L 2 , we define their concatenation to be the language L 1 ◦ L 2 = {xy | x ∈ L 1 , y ∈ L 2 }
Example L 1 = {hello} and L 2 = {world} then L 1 ◦ L 2 =
Regular Expressions
Definition Given languages L 1 and L 2 , we define their concatenation to be the language L 1 ◦ L 2 = {xy | x ∈ L 1 , y ∈ L 2 }
Example L 1 = {hello} and L 2 = {world} then L 1 ◦ L 2 = {helloworld}
Regular Expressions
Definition Given languages L 1 and L 2 , we define their concatenation to be the language L 1 ◦ L 2 = {xy | x ∈ L 1 , y ∈ L 2 }
Example L 1 = {hello} and L 2 = {world} then L 1 ◦ L 2 = {helloworld} L 1 = { 00 , 10 }; L 2 = { 0 , 1 }. L 1 ◦ L 2 = { 000 , 001 , 100 , 101 }
Regular Expressions
Definition Given languages L 1 and L 2 , we define their concatenation to be the language L 1 ◦ L 2 = {xy | x ∈ L 1 , y ∈ L 2 }
Example L 1 = {hello} and L 2 = {world} then L 1 ◦ L 2 = {helloworld} L 1 = { 00 , 10 }; L 2 = { 0 , 1 }. L 1 ◦ L 2 = { 000 , 001 , 100 , 101 } L 1 = set of strings ending in 0; L 2 = set of strings beginning with 01. L 1 ◦ L 2 =
Regular Expressions
Definition Given languages L 1 and L 2 , we define their concatenation to be the language L 1 ◦ L 2 = {xy | x ∈ L 1 , y ∈ L 2 }
Example L 1 = {hello} and L 2 = {world} then L 1 ◦ L 2 = {helloworld} L 1 = { 00 , 10 }; L 2 = { 0 , 1 }. L 1 ◦ L 2 = { 000 , 001 , 100 , 101 } L 1 = set of strings ending in 0; L 2 = set of strings beginning with 01. L 1 ◦ L 2 = set of strings containing 001 as a substring L ◦ {} =
Regular Expressions
Definition Given languages L 1 and L 2 , we define their concatenation to be the language L 1 ◦ L 2 = {xy | x ∈ L 1 , y ∈ L 2 }
Example L 1 = {hello} and L 2 = {world} then L 1 ◦ L 2 = {helloworld} L 1 = { 00 , 10 }; L 2 = { 0 , 1 }. L 1 ◦ L 2 = { 000 , 001 , 100 , 101 } L 1 = set of strings ending in 0; L 2 = set of strings beginning with 01. L 1 ◦ L 2 = set of strings containing 001 as a substring L ◦ {} = L.
Regular Expressions
Definition Given languages L 1 and L 2 , we define their concatenation to be the language L 1 ◦ L 2 = {xy | x ∈ L 1 , y ∈ L 2 }
Example L 1 = {hello} and L 2 = {world} then L 1 ◦ L 2 = {helloworld} L 1 = { 00 , 10 }; L 2 = { 0 , 1 }. L 1 ◦ L 2 = { 000 , 001 , 100 , 101 } L 1 = set of strings ending in 0; L 2 = set of strings beginning with 01. L 1 ◦ L 2 = set of strings containing 001 as a substring L ◦ {} = L. L ◦ ∅ = ∅.
Regular Expressions
Definition
Ln^ =
{} if n = 0 Ln−^1 ◦ L otherwise