Application of Regular Expression
Application of Regular Expression
REGULAR EXPRESSION
KAVANA K A
1DB20CS056
REGULAR EXPRESSION
● ε is a Regular Expression indicates the language containing an empty string. (L (ε) = {ε})
● φ is a Regular Expression denoting an empty language. (L (φ) = { })
● x is a Regular Expression where L = {x}
● If X is a Regular Expression denoting the language L(X) and Y is a Regular Expression
denoting the language L(Y), then
○ X + Y is a Regular Expression corresponding to the language L(X) ∪ L(Y) where
L(X+Y) = L(X) ∪ L(Y).
○ X . Y is a Regular Expression corresponding to the language L(X) . L(Y) where L(X.Y)
= L(X) . L(Y)
○ R* is a Regular Expression corresponding to the language L(R*)where L(R*) = (L(R))*
APPLICATION OF REGULAR EXPRESSION
Regular expressions are extensively used in Unix operating system. But certain
short notations are used in UNIX platform using which complex regular
expressions are avoided. For example , the symbol ‘.’ stands for any
character , the sequence [ a b c d e….] stands for the regular expression
“a + b+ c+ d+ e………”,the operator | is used in place of +,the operator ?
means “zero or one of” etc . most of the commands are invoked invariably
uses regular expressions .For example , grep (global search for regular
expression and print) used to search for a pattern of string