0% found this document useful (0 votes)
18 views6 pages

Union and Kleene Star in Regex

Regular expressions are algebraic representations of certain sets of strings, utilizing operations such as union, concatenation, and Kleene star. The union operator matches either of two expressions, while concatenation matches one expression followed by another. The Kleene star matches zero or more occurrences of an expression, and the document also discusses converting regular expressions to NFA using Thompson's construction.

Uploaded by

anu13papa
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
18 views6 pages

Union and Kleene Star in Regex

Regular expressions are algebraic representations of certain sets of strings, utilizing operations such as union, concatenation, and Kleene star. The union operator matches either of two expressions, while concatenation matches one expression followed by another. The Kleene star matches zero or more occurrences of an expression, and the document also discusses converting regular expressions to NFA using Thompson's construction.

Uploaded by

anu13papa
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Regular Expressions

PK EDUCATION
" Regular expressions are used for representing certain sets of
strings in an algebraic fashion.
A regular expression is a string that represents a regular language
ECOng
using
PK
concatenationP Kand Kleene star operations.
Educationa

atb ab
jitute
Regular Expressions
(0) Union: a+b (or) a |b
"b'
ne expression 'a' or the expression
"Matches either the
" Also known as OR operator. ycational Institute

(i) Concatentia..
"Matches the expression 'a followed by the expressionpional
"b'. Institu
"Also known as AND operator.
Regular Expressions
(ii) Kleene Star: a*
Matches zero or more occurrences of the expression 'a'.
"(iv)a* Klesducationtvea
={[, a, aa, Institute
rrenucational
Plus: at or aa*
" Matches one or more of the expression 'a'.n aInstitut
l

" at ={a, aa, aaa,...)


ORegular expression to NEA (Thompson's construction)
3. For regular expression slt or (st)

start

For Example: (ab) or (a + b)


ORegular expression to NFA (Thompson's construction)
4. For regular expression st

start,
N(S) N)

For Example: ab
ORegular expression to NFA (Thompson's construction)
s. For regular expression s
start

For Example : a

You might also like