Regular Expressions and Regular Languages - Hacettepe
Regular Expressions and Regular Languages
? Regular Expressions ? Converting Regular Expressions to NFA ? Converting Finite Automata to Regular
Expressions ? Algebraic Laws for Regular Expressions
BBM401 Automata Theory and Formal Languages
1
Regular Expressions
? We used Finite Automata to describe regular languages. ? We can also use regular expressions to describe regular languages.
? Regular Expressions are an algebraic way to describe languages. ? Regular Expressions describe exactly the regular languages. ? If E is a regular expression, then L(E) is the regular language that it defines. ? For each regular expression E, we can create a DFA A such that L(E) = L(A). ? For each a DFA A, we can create a regular expression E such that L(A) = L(E) ? A regular expression is built up of simpler regular expressions (using defining rules)
BBM401 Automata Theory and Formal Languages
2
Operations on Languages
? Remember: A language is a set of strings ? We can perform operations on languages.
Union: Concatenation: Powers: Kleene Closure:
L M = { w : w L or w M } L.M = { w : w=xy, x L, y M } L0 = { } , L1 = L , Lk+1 = L. Lk L* = = Li
BBM401 Automata Theory and Formal Languages
3
Operations on Languages - Examples
L = {00,11}
M = {1,01,11}
L M = {00,11,1,01}
L.M = {001,0001,0011,111,1101,1111}
L0 = {}
L1= L ={00,11} L2={0000,0011,1100,1111}
L*={, 00, 11, 0000, 0011, 1100, 1111, 000000, 000011, ...}
Kleene closures of all languages (except two of them) are infinite.
1. * = {}* = {} 2. {}* = {}
BBM401 Automata Theory and Formal Languages
4
Regular Expressions - Definition
Regular expressions over alphabet
Basis 1: Basis 2: Basis 3:
Reg. Expr. E a
Language it denotes L(E) { } {} {a}
Note: {a} is the language containing one string, and that string is of length 1.
BBM401 Automata Theory and Formal Languages
5
................
................
In order to avoid copyright disputes, this page is only a partial summary.
To fulfill the demand for quickly locating and searching documents.
It is intelligent file search solution for home and business.
Related download
- patterns automata and regular expressions stanford university
- understanding regular expressions special characters and patterns cisco
- regular expression tutorial by glen mcgregor
- regular expressions for natural language processing
- regular expressions stanford university
- 1 regular expression tutorial
- regular expressions the complete tutorial by jan goyvaerts
- c is evolving university of alaska system
- lecture 11b regular expressions university of washington
- lecture 18 regular expressions cmu school of computer science
Related searches
- common english expressions and idioms
- popular expressions and sayings
- meanings of expressions and sayings
- dictionary of expressions and idioms
- calculator for expressions and equations
- expressions and equations practice
- regular expressions js
- using regular expressions in java
- regular expressions tutorial
- regular expressions in java
- java regular expressions tutorial
- irregular and regular verbs pdf