SlideShare a Scribd company logo
1 of 21
APPLICATION OF
REGULAR EXPRESSION
Ankit G – 014
Gagan – 034
Nikhil R.K- 060
Parashuram - 065
•A regular expression (regex) describes a pattern to match multiple input strings.
•Regular expressions descend from a fundamental concept in Computer Science
called finite automata theory
•Regular expressions are endemic to Unix
•Some utilities/programs that use them:
– vi, ed, sed, and emacs
– awk, tcl, perl and Python
– grep, egrep, fgrep
– compilers
•The simplest regular expression is a string of literal characters to match.
•The string matches the regular expression if it contains the substring.
What is a Regular Expression?
INTRODUCTION
Application in Linux
The “egrep” Tool
Copyright © 2007 by Adam Webber
Text File Search
• Unix tool: egrep
• Searches a text file for lines that contain
a substring matching a specified pattern
• Echoes all such lines to standard output
In linux operating System:
 Regular expressions are used by several different
Unix commands, including ed, sed, awk,
grep, and, to a more limited extent, vi.
 Sed also understands something called addresses.
Addresses are either particular locations in a file or
a range where a particular editing command
should be applied. When Sed encounters no
addresses, it performs its operations on every line
in the file.
 Sed stands for stream editor is a stream oriented
editor which was created exclusively for executing
scripts. Thus all the input you feed into it passes
through and goes to STDOUT and it does not change
the input file.
 Oracles implementation is the extension of the
POSIX
(Portable Operating system for UNIX)
Editing Commands
COMMANDS ACTION
Insert
i, a
I, A
o, O
Insert text before, after cursor
Insert text before beginning, after end of line
Open new line for text below, above cursor
Editing Commands
COMMANDS ACTION
Change
r
cw
c
Replace character
Change word
Change current line
cmotion
C
R
s
Change text between the cursor and the target
of motion
Change to end of line
Type over (overwrite) characters
Substitute: delete character and insert new text
S Substitute: delete current line and insert new text
Application in Search Engine
 One use of regular expressions that used to be very
common was in web search engines.
 Archie, one of the first search engines, used regular
expressions exclusively to search through a database
of filenames on servers.
 Regular expressions were chosen for these early
search engines because of both their power and easy
implementation.
 In the case of a search engine, the strings input to
the regular expression would be either whole web
pages or a pre-computed index of a web page that
holds only the most important information from
that web page.
 A query such as regular expression could be
translated into the following regular expression.
(Σ∗regularΣ∗expressionΣ∗ )∗∪
(Σ∗expressionΣ∗regularΣ∗ )∗ Σ, then, of course,
would be the set of all characters in the character
encoding used with this search engine.
 Regular expressions are not used anymore in the
large web search engines because with the growth of
the web it became impossibly slow to use regular
expressions. They are however still used in many
smaller search engines such as a find/replace tool in
a text editor or tools such as grep.
In web application String matching is used
Regular Expressions in Lexical Analysis
 To perform lexical analysis, two components are
required: a scanner and a tokenizer.
 The purpose of tokenization is to categorize the
lexemes found in a string to sort them by meaning.
 The process can be considered a sub-task of parsing
input.
 For example, the C programming language could
contain tokens such as numbers, string constants,
characters, identifiers (variable names), keywords, or
operators.
 We can simply define a set of regular expressions,
each matching the valid set of lexemes that belong to
this token type. This is the process of scanning.
 This process can be quite complex and may require
more than one pass to complete.
Another option is to use a process known as
backtracking
 For example, to determine if a lexeme is a valid
identifier in C, we could use the following regular
expression: [a-zA-Z ][a-zA-Z 0-9]∗ This regular
expression says that identifiers must begin with a
Roman letter or an underscore and may be followed
by any number of letters, underscores, or numbers
CONCLUSION
 Both regular expressions and finite-state automata
represent regular languages.
 The basic regular expression operations are:
concatenation, union/disjunction, and Keene closure.
 The regular expression language is a powerful pattern-
matching tool.
 Any regular expression can be automatically compiled
into an NFA, to a DFA, and to a unique minimum-state
DFA.
 An FSA can use any set of symbols for its alphabet,
including letters and words.
THANK YOU

More Related Content

What's hot

Fundamental of C Programming Language and Basic Input/Output Function
  Fundamental of C Programming Language and Basic Input/Output Function  Fundamental of C Programming Language and Basic Input/Output Function
Fundamental of C Programming Language and Basic Input/Output Functionimtiazalijoono
 
Method Overloading In Java
Method Overloading In JavaMethod Overloading In Java
Method Overloading In JavaCharthaGaglani
 
Multidimensional array in C
Multidimensional array in CMultidimensional array in C
Multidimensional array in CSmit Parikh
 
ITFT-Constants, variables and data types in java
ITFT-Constants, variables and data types in javaITFT-Constants, variables and data types in java
ITFT-Constants, variables and data types in javaAtul Sehdev
 
Command line arguments
Command line argumentsCommand line arguments
Command line argumentsAshok Raj
 
VB.NET:An introduction to Namespaces in .NET framework
VB.NET:An introduction to  Namespaces in .NET frameworkVB.NET:An introduction to  Namespaces in .NET framework
VB.NET:An introduction to Namespaces in .NET frameworkRicha Handa
 
Array in c language
Array in c languageArray in c language
Array in c languagehome
 
Structure of the compiler
Structure of the compilerStructure of the compiler
Structure of the compilerSudhaa Ravi
 
Finite Automata: Deterministic And Non-deterministic Finite Automaton (DFA)
Finite Automata: Deterministic And Non-deterministic Finite Automaton (DFA)Finite Automata: Deterministic And Non-deterministic Finite Automaton (DFA)
Finite Automata: Deterministic And Non-deterministic Finite Automaton (DFA)Mohammad Ilyas Malik
 
Symbol Table, Error Handler & Code Generation
Symbol Table, Error Handler & Code GenerationSymbol Table, Error Handler & Code Generation
Symbol Table, Error Handler & Code GenerationAkhil Kaushik
 
Finite automata(For college Seminars)
Finite automata(For college Seminars)Finite automata(For college Seminars)
Finite automata(For college Seminars)Naman Joshi
 
Intermediate code generation (Compiler Design)
Intermediate code generation (Compiler Design)   Intermediate code generation (Compiler Design)
Intermediate code generation (Compiler Design) Tasif Tanzim
 
Chapter 6 intermediate code generation
Chapter 6   intermediate code generationChapter 6   intermediate code generation
Chapter 6 intermediate code generationVipul Naik
 
Type checking in compiler design
Type checking in compiler designType checking in compiler design
Type checking in compiler designSudip Singh
 

What's hot (20)

Fundamental of C Programming Language and Basic Input/Output Function
  Fundamental of C Programming Language and Basic Input/Output Function  Fundamental of C Programming Language and Basic Input/Output Function
Fundamental of C Programming Language and Basic Input/Output Function
 
Method Overloading In Java
Method Overloading In JavaMethod Overloading In Java
Method Overloading In Java
 
Multidimensional array in C
Multidimensional array in CMultidimensional array in C
Multidimensional array in C
 
ITFT-Constants, variables and data types in java
ITFT-Constants, variables and data types in javaITFT-Constants, variables and data types in java
ITFT-Constants, variables and data types in java
 
Command line arguments
Command line argumentsCommand line arguments
Command line arguments
 
VB.NET:An introduction to Namespaces in .NET framework
VB.NET:An introduction to  Namespaces in .NET frameworkVB.NET:An introduction to  Namespaces in .NET framework
VB.NET:An introduction to Namespaces in .NET framework
 
Array in c language
Array in c languageArray in c language
Array in c language
 
Structure of the compiler
Structure of the compilerStructure of the compiler
Structure of the compiler
 
Finite Automata: Deterministic And Non-deterministic Finite Automaton (DFA)
Finite Automata: Deterministic And Non-deterministic Finite Automaton (DFA)Finite Automata: Deterministic And Non-deterministic Finite Automaton (DFA)
Finite Automata: Deterministic And Non-deterministic Finite Automaton (DFA)
 
Symbol Table, Error Handler & Code Generation
Symbol Table, Error Handler & Code GenerationSymbol Table, Error Handler & Code Generation
Symbol Table, Error Handler & Code Generation
 
NLP_KASHK:Morphology
NLP_KASHK:MorphologyNLP_KASHK:Morphology
NLP_KASHK:Morphology
 
Parsing
ParsingParsing
Parsing
 
Finite automata(For college Seminars)
Finite automata(For college Seminars)Finite automata(For college Seminars)
Finite automata(For college Seminars)
 
Intermediate code generation (Compiler Design)
Intermediate code generation (Compiler Design)   Intermediate code generation (Compiler Design)
Intermediate code generation (Compiler Design)
 
First and follow set
First and follow setFirst and follow set
First and follow set
 
Chapter 6 intermediate code generation
Chapter 6   intermediate code generationChapter 6   intermediate code generation
Chapter 6 intermediate code generation
 
Classes objects in java
Classes objects in javaClasses objects in java
Classes objects in java
 
Type checking in compiler design
Type checking in compiler designType checking in compiler design
Type checking in compiler design
 
Compiler design
Compiler designCompiler design
Compiler design
 
Java Cheat Sheet
Java Cheat SheetJava Cheat Sheet
Java Cheat Sheet
 

Viewers also liked

Linux : Booting and runlevels
Linux : Booting and runlevelsLinux : Booting and runlevels
Linux : Booting and runlevelsJohn Ombagi
 
Regular expression (compiler)
Regular expression (compiler)Regular expression (compiler)
Regular expression (compiler)Jagjit Wilku
 
Regular expressions
Regular expressionsRegular expressions
Regular expressionsRaj Gupta
 
6 stages of linux boot process
6 stages of linux boot process6 stages of linux boot process
6 stages of linux boot processTeja Bheemanapally
 
Two-way Deterministic Finite Automata
Two-way Deterministic Finite AutomataTwo-way Deterministic Finite Automata
Two-way Deterministic Finite AutomataHafsa.Naseem
 
NFA or Non deterministic finite automata
NFA or Non deterministic finite automataNFA or Non deterministic finite automata
NFA or Non deterministic finite automatadeepinderbedi
 
Linux Introduction (Commands)
Linux Introduction (Commands)Linux Introduction (Commands)
Linux Introduction (Commands)anandvaidya
 

Viewers also liked (13)

Regular Expression
Regular ExpressionRegular Expression
Regular Expression
 
Regular Expression
Regular ExpressionRegular Expression
Regular Expression
 
Linux : Booting and runlevels
Linux : Booting and runlevelsLinux : Booting and runlevels
Linux : Booting and runlevels
 
Regular expression (compiler)
Regular expression (compiler)Regular expression (compiler)
Regular expression (compiler)
 
Regular expressions
Regular expressionsRegular expressions
Regular expressions
 
6 stages of linux boot process
6 stages of linux boot process6 stages of linux boot process
6 stages of linux boot process
 
interface in c#
interface in c#interface in c#
interface in c#
 
Two-way Deterministic Finite Automata
Two-way Deterministic Finite AutomataTwo-way Deterministic Finite Automata
Two-way Deterministic Finite Automata
 
Regular expression (compiler)
Regular expression (compiler)Regular expression (compiler)
Regular expression (compiler)
 
Vi editor in linux
Vi editor in linuxVi editor in linux
Vi editor in linux
 
NFA or Non deterministic finite automata
NFA or Non deterministic finite automataNFA or Non deterministic finite automata
NFA or Non deterministic finite automata
 
Linux Introduction (Commands)
Linux Introduction (Commands)Linux Introduction (Commands)
Linux Introduction (Commands)
 
Slideshare ppt
Slideshare pptSlideshare ppt
Slideshare ppt
 

Similar to Finaal application on regular expression

Lecture 18 - Regular Expressions.pdf
Lecture 18 - Regular Expressions.pdfLecture 18 - Regular Expressions.pdf
Lecture 18 - Regular Expressions.pdfSaravana Kumar
 
Python regular expressions
Python regular expressionsPython regular expressions
Python regular expressionsKrishna Nanda
 
Python Programming Basics for begginners
Python Programming Basics for begginnersPython Programming Basics for begginners
Python Programming Basics for begginnersAbishek Purushothaman
 
101 3.7 search text files using regular expressions
101 3.7 search text files using regular expressions101 3.7 search text files using regular expressions
101 3.7 search text files using regular expressionsAcácio Oliveira
 
101 3.7 search text files using regular expressions
101 3.7 search text files using regular expressions101 3.7 search text files using regular expressions
101 3.7 search text files using regular expressionsAcácio Oliveira
 
3.7 search text files using regular expressions
3.7 search text files using regular expressions3.7 search text files using regular expressions
3.7 search text files using regular expressionsAcácio Oliveira
 
C presentation! BATRA COMPUTER CENTRE
C presentation! BATRA  COMPUTER  CENTRE C presentation! BATRA  COMPUTER  CENTRE
C presentation! BATRA COMPUTER CENTRE jatin batra
 
automata theroy and compiler designc.pptx
automata theroy and compiler designc.pptxautomata theroy and compiler designc.pptx
automata theroy and compiler designc.pptxYashaswiniYashu9555
 
Lexical Analysis - Compiler design
Lexical Analysis - Compiler design Lexical Analysis - Compiler design
Lexical Analysis - Compiler design Aman Sharma
 
Language for specifying lexical Analyzer
Language for specifying lexical AnalyzerLanguage for specifying lexical Analyzer
Language for specifying lexical AnalyzerArchana Gopinath
 
CSharp for Unity Day 3
CSharp for Unity Day 3CSharp for Unity Day 3
CSharp for Unity Day 3Duong Thanh
 
role of lexical anaysis
role of lexical anaysisrole of lexical anaysis
role of lexical anaysisSudhaa Ravi
 
Csharp4 strings and_regular_expressions
Csharp4 strings and_regular_expressionsCsharp4 strings and_regular_expressions
Csharp4 strings and_regular_expressionsAbed Bukhari
 
Basic Concepts of C Language.pptx
Basic Concepts of C Language.pptxBasic Concepts of C Language.pptx
Basic Concepts of C Language.pptxKorbanMaheshwari
 

Similar to Finaal application on regular expression (20)

Lecture 18 - Regular Expressions.pdf
Lecture 18 - Regular Expressions.pdfLecture 18 - Regular Expressions.pdf
Lecture 18 - Regular Expressions.pdf
 
Module4 lex and yacc.ppt
Module4 lex and yacc.pptModule4 lex and yacc.ppt
Module4 lex and yacc.ppt
 
Python regular expressions
Python regular expressionsPython regular expressions
Python regular expressions
 
Python Programming Basics for begginners
Python Programming Basics for begginnersPython Programming Basics for begginners
Python Programming Basics for begginners
 
Pcd question bank
Pcd question bank Pcd question bank
Pcd question bank
 
101 3.7 search text files using regular expressions
101 3.7 search text files using regular expressions101 3.7 search text files using regular expressions
101 3.7 search text files using regular expressions
 
101 3.7 search text files using regular expressions
101 3.7 search text files using regular expressions101 3.7 search text files using regular expressions
101 3.7 search text files using regular expressions
 
3.7 search text files using regular expressions
3.7 search text files using regular expressions3.7 search text files using regular expressions
3.7 search text files using regular expressions
 
Compiler design Project
Compiler design ProjectCompiler design Project
Compiler design Project
 
RegEx Parsing
RegEx ParsingRegEx Parsing
RegEx Parsing
 
C presentation! BATRA COMPUTER CENTRE
C presentation! BATRA  COMPUTER  CENTRE C presentation! BATRA  COMPUTER  CENTRE
C presentation! BATRA COMPUTER CENTRE
 
automata theroy and compiler designc.pptx
automata theroy and compiler designc.pptxautomata theroy and compiler designc.pptx
automata theroy and compiler designc.pptx
 
11700220036.pdf
11700220036.pdf11700220036.pdf
11700220036.pdf
 
Lexical Analysis - Compiler design
Lexical Analysis - Compiler design Lexical Analysis - Compiler design
Lexical Analysis - Compiler design
 
Parsing
ParsingParsing
Parsing
 
Language for specifying lexical Analyzer
Language for specifying lexical AnalyzerLanguage for specifying lexical Analyzer
Language for specifying lexical Analyzer
 
CSharp for Unity Day 3
CSharp for Unity Day 3CSharp for Unity Day 3
CSharp for Unity Day 3
 
role of lexical anaysis
role of lexical anaysisrole of lexical anaysis
role of lexical anaysis
 
Csharp4 strings and_regular_expressions
Csharp4 strings and_regular_expressionsCsharp4 strings and_regular_expressions
Csharp4 strings and_regular_expressions
 
Basic Concepts of C Language.pptx
Basic Concepts of C Language.pptxBasic Concepts of C Language.pptx
Basic Concepts of C Language.pptx
 

Recently uploaded

Karra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptxKarra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptxAshokKarra1
 
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITYISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITYKayeClaireEstoconing
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatYousafMalik24
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...JhezDiaz1
 
Full Stack Web Development Course for Beginners
Full Stack Web Development Course  for BeginnersFull Stack Web Development Course  for Beginners
Full Stack Web Development Course for BeginnersSabitha Banu
 
Science 7 Quarter 4 Module 2: Natural Resources.pptx
Science 7 Quarter 4 Module 2: Natural Resources.pptxScience 7 Quarter 4 Module 2: Natural Resources.pptx
Science 7 Quarter 4 Module 2: Natural Resources.pptxMaryGraceBautista27
 
ACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdfACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdfSpandanaRallapalli
 
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)lakshayb543
 
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdfAMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdfphamnguyenenglishnb
 
Roles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceRoles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceSamikshaHamane
 
Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Mark Reed
 
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17Celine George
 
DATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersDATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersSabitha Banu
 
How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17Celine George
 
4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptx4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptxmary850239
 
Q4 English4 Week3 PPT Melcnmg-based.pptx
Q4 English4 Week3 PPT Melcnmg-based.pptxQ4 English4 Week3 PPT Melcnmg-based.pptx
Q4 English4 Week3 PPT Melcnmg-based.pptxnelietumpap1
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTiammrhaywood
 

Recently uploaded (20)

Karra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptxKarra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptx
 
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITYISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice great
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
 
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
 
Full Stack Web Development Course for Beginners
Full Stack Web Development Course  for BeginnersFull Stack Web Development Course  for Beginners
Full Stack Web Development Course for Beginners
 
Science 7 Quarter 4 Module 2: Natural Resources.pptx
Science 7 Quarter 4 Module 2: Natural Resources.pptxScience 7 Quarter 4 Module 2: Natural Resources.pptx
Science 7 Quarter 4 Module 2: Natural Resources.pptx
 
ACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdfACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdf
 
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
 
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdfAMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
 
Roles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceRoles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in Pharmacovigilance
 
Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)
 
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
 
DATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersDATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginners
 
How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17
 
LEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptx
LEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptxLEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptx
LEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptx
 
4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptx4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptx
 
YOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptx
YOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptxYOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptx
YOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptx
 
Q4 English4 Week3 PPT Melcnmg-based.pptx
Q4 English4 Week3 PPT Melcnmg-based.pptxQ4 English4 Week3 PPT Melcnmg-based.pptx
Q4 English4 Week3 PPT Melcnmg-based.pptx
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
 

Finaal application on regular expression

  • 1. APPLICATION OF REGULAR EXPRESSION Ankit G – 014 Gagan – 034 Nikhil R.K- 060 Parashuram - 065
  • 2. •A regular expression (regex) describes a pattern to match multiple input strings. •Regular expressions descend from a fundamental concept in Computer Science called finite automata theory •Regular expressions are endemic to Unix •Some utilities/programs that use them: – vi, ed, sed, and emacs – awk, tcl, perl and Python – grep, egrep, fgrep – compilers •The simplest regular expression is a string of literal characters to match. •The string matches the regular expression if it contains the substring. What is a Regular Expression? INTRODUCTION
  • 3.
  • 4.
  • 5.
  • 6.
  • 7. Application in Linux The “egrep” Tool
  • 8. Copyright © 2007 by Adam Webber Text File Search • Unix tool: egrep • Searches a text file for lines that contain a substring matching a specified pattern • Echoes all such lines to standard output
  • 9. In linux operating System:  Regular expressions are used by several different Unix commands, including ed, sed, awk, grep, and, to a more limited extent, vi.  Sed also understands something called addresses. Addresses are either particular locations in a file or a range where a particular editing command should be applied. When Sed encounters no addresses, it performs its operations on every line in the file.
  • 10.  Sed stands for stream editor is a stream oriented editor which was created exclusively for executing scripts. Thus all the input you feed into it passes through and goes to STDOUT and it does not change the input file.  Oracles implementation is the extension of the POSIX (Portable Operating system for UNIX)
  • 11. Editing Commands COMMANDS ACTION Insert i, a I, A o, O Insert text before, after cursor Insert text before beginning, after end of line Open new line for text below, above cursor
  • 12. Editing Commands COMMANDS ACTION Change r cw c Replace character Change word Change current line cmotion C R s Change text between the cursor and the target of motion Change to end of line Type over (overwrite) characters Substitute: delete character and insert new text S Substitute: delete current line and insert new text
  • 13. Application in Search Engine  One use of regular expressions that used to be very common was in web search engines.  Archie, one of the first search engines, used regular expressions exclusively to search through a database of filenames on servers.  Regular expressions were chosen for these early search engines because of both their power and easy implementation.
  • 14.  In the case of a search engine, the strings input to the regular expression would be either whole web pages or a pre-computed index of a web page that holds only the most important information from that web page.  A query such as regular expression could be translated into the following regular expression. (Σ∗regularΣ∗expressionΣ∗ )∗∪ (Σ∗expressionΣ∗regularΣ∗ )∗ Σ, then, of course, would be the set of all characters in the character encoding used with this search engine.
  • 15.  Regular expressions are not used anymore in the large web search engines because with the growth of the web it became impossibly slow to use regular expressions. They are however still used in many smaller search engines such as a find/replace tool in a text editor or tools such as grep.
  • 16. In web application String matching is used
  • 17. Regular Expressions in Lexical Analysis  To perform lexical analysis, two components are required: a scanner and a tokenizer.  The purpose of tokenization is to categorize the lexemes found in a string to sort them by meaning.  The process can be considered a sub-task of parsing input.
  • 18.  For example, the C programming language could contain tokens such as numbers, string constants, characters, identifiers (variable names), keywords, or operators.  We can simply define a set of regular expressions, each matching the valid set of lexemes that belong to this token type. This is the process of scanning.
  • 19.  This process can be quite complex and may require more than one pass to complete. Another option is to use a process known as backtracking  For example, to determine if a lexeme is a valid identifier in C, we could use the following regular expression: [a-zA-Z ][a-zA-Z 0-9]∗ This regular expression says that identifiers must begin with a Roman letter or an underscore and may be followed by any number of letters, underscores, or numbers
  • 20. CONCLUSION  Both regular expressions and finite-state automata represent regular languages.  The basic regular expression operations are: concatenation, union/disjunction, and Keene closure.  The regular expression language is a powerful pattern- matching tool.  Any regular expression can be automatically compiled into an NFA, to a DFA, and to a unique minimum-state DFA.  An FSA can use any set of symbols for its alphabet, including letters and words.