Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 19

Internship seminar on

Pattern Matching using Regular Expressions


Punith S
(1AH16CS030)

WebLogik 29/8, Mirza Hyder Ali Street Royapettah, Chennai - 600 014 India.

Internal Guide External Guide


Mrs. Sunita Chalageri Mr. Sarfaraz Ahmed
Assistant Professor Director - WebLigik
Contents

 Introduction

 Tools and Technology

 Objectives

 Working of the System

 Results

 Conclusion
Introduction
 Airline Files
These are the files which contains all the
information about the general rules of the airline like
surcharges, penalties, children discounts and etc.
• It also includes the information about the Flight
application, Stopovers and Transfer charges.
• In this file among all these data we need to select
only the required data from every section.
• In earlier days this process of extraction of data from
the airline files was done manually.
• Since each airline file contain 9 to 10 subfiles, which
includes around 15 sections in each subfile, it is very
difficult and time consuming process for the
employees to extract the required data manually.
• Then comes the idea of usage of single pattern to
select ‘n’ group of data.
• These patterns are created by the use of regular
expressions.
Tools and Technology
 Regular Expressions(Regex): A regex is a string of
text that allows you to create patterns that help
match, locate, and manage text.
 Pattern Matching: Pattern matching is the act of
checking a given sequence of tokens for the presence
of the constituents of some pattern. In contrast to
pattern recognition, the match has to extract either it
will or will not be match.
 Regex Methods:
 Metacharacters in Regex:
 Special Sequences:
 Software used:
• Pycharm: Pycharm is an integrated development
environment used in computer programming,
specifically for the Python language. It is developed
by the Czech company JetBrains.
• Postman: Postman is a Google Chrome app for
interacting with HTTP APIs. It presents you with a
friendly GUI for constructing requests and reading
responses. The people behind Postman also offer
an add-on package called Jetpacks, which includes
some automation tools and, most crucially, a
Javascript testing library.
Objectives

 To produce a regular expression to match the pattern


required in the airlines data file.

 To generate the code which performs the pattern


matching operation on the airlines data file.
Working of the System

❑ The first main Step was to analyze the Airlines


NLP Files given to us.
❑ We had to scan and analyze the data and make a
list of the data to be retrieved from the file.
❑ For each airline NLP, we generated the regular
expression to cover all the text variations to cover
all the required fields. The main task was to
determine the percentage and premium discount
charges for each folder as well as the penalty or
discount condition.
Working of the System

 We then generated classes and functions for each airline


to retrieve the NLP and use the regex created to find the
appropriate files to perform the calculation that included
Departure Conditions, Child Discount, Infant Discount,
No-Show Penalties, Pre-Departure Change Penalties, etc.
 Postman was used to send the HTTP request to the
server which was running. The request is the NLP file in
the form of a JSON which contains the Airline name
which is useful for python to identify the airline using the
airline code and run that particular file.
 Once the calculation is performed, we then store the
result in form of a list and send it back to the Postman as
a HTTP response.
Results
Results
Results
Results
Conclusion
 Since the airline data file is divided into several
sections, for each section it requires different code.

 It requires more time for testing since the Postman


software tests only one subfile at a time.
Thank You

You might also like