SlideShare a Scribd company logo
Regular Expression inRegular Expression in
ActionAction
www.folio3.com@folio_3
Folio3 – OverviewFolio3 – Overview
www.folio3.com @folio_3
Who We Are
 We are a Development Partner for our customers
 Design software solutions, not just implement them
 Focus on the solution – Platform and technology agnostic
 Expertise in building applications that are:
Mobile Social Cloud-based Gamified
What We Do
 Areas of Focus
 Enterprise
 Custom enterprise applications
 Product development targeting the enterprise
 Mobile
 Custom mobile apps for iOS, Android, Windows Phone, BB OS
 Mobile platform (server-to-server) development
 Social Media
 CMS based websites for consumers and enterprise (corporate, consumer,
community & social networking)
 Social media platform development (enterprise & consumer)
Folio3 At a Glance
 Founded in 2005
 Over 200 full time employees
 Offices in the US, Canada, Bulgaria & Pakistan
 Palo Alto, CA.
 Sofia, Bulgaria
 Karachi, Pakistan
Toronto, Canada
Areas of Focus: Enterprise
 Automating workflows
 Cloud based solutions
 Application integration
 Platform development
 Healthcare
 Mobile Enterprise
 Digital Media
 Supply Chain
Some of Our Enterprise Clients
Areas of Focus: Mobile
 Serious enterprise applications for Banks,
Businesses
 Fun consumer apps for app discovery,
interaction, exercise gamification and play
 Educational apps
 Augmented Reality apps
 Mobile Platforms
Some of Our Mobile Clients
Areas of Focus: Web & Social Media
 Community Sites based on
Content Management Systems
 Enterprise Social Networking
 Social Games for Facebook &
Mobile
 Companion Apps for games
Some of Our Web Clients
Regular Expression inRegular Expression in
ActionAction
www.folio3.com @folio_3
Agenda
 What are Regular Expressions
 Literal characters and Special characters
 Build blocks of Regular Expressions
 Grouping and Backreferences
 Unicode characters in regular expressions
 Regex Matching Modes
 Lookarounds
 Parse a log file…
What are Regular Expressions?
 Regular expressions provide a concise and flexible means for
matching strings of text, such as particular characters, words,
or patterns of characters.
Literal and Special characters
 The most basic regular expression consists of a literal which
behaves just like string matching. For e.g.
 cat will match cat in About cats and dogs.
 Special characters known as meta characters needs to be
escaped with a  in regular expressions if they are used as
part of a literal:
 dogs. will match dogs. in About cats and dogs.
 Meta characters are:
 [  ^ $ . | ? * + ( ) {
Character Classes and Shorthands
 With a "character class", also called "character set", you can tell
the regex engine to match only one out of several characters. For
e.g.
 gr[ae]y will match grey and gray both.
 Ranges can be specified using dash. For e.g.
 [0-9] will match any digit from 0 to 9.
 [0-9a-fA-F] will match any single hexadecimal digit.
 Caret after the opening square bracket will negate the character
class. The result is that the character class will match any
character that is not in the character class. For e.g.
 [^0-9] will match any thing except number.
 q[^u] will not match Iraq but it will match Iraq is a country
Character Classes and Shorthands
 Meta characters works fine without escaping in Character classes.
For e.g.
 [+*] is a valid expression and match either * or +.
 There are some pre-defined character classes known as short
hand character classes:
 w stands for [A-Za-z0-9_]
 s stands for [ trn]
 d stands for [0-9]
 If a character class is repeated by using the ?, * or + operators,
the entire character class will be repeated, and not just the
character that it matched. For e.g.
 [0-9]+ can match 837 as well as 222
 ([0-9])1+ will match 222 but not 837.
Building blocks of Regular Exp.
 The famous dot “.” operator matches anything. For e.g.
 a.b will match abb, aab, a+b etc.
 ^ and $ are used to match start and end of regular expressions.
For e.g.
 ^My.*.$ will match anything starting with My and ending
with a dot.
 Pipe operator is used to match a string against either its left or
the right part. For e.g.
 (cat|dog) can match both cat or dog.
 Question:
 If the expression is Get|GetValue|Set|SetValue and string
is SetValue. What will this match and why?
 What if the expression becomes Get(Value)?|Set(Value)?
 * or {0,} and + or {1,} are used to control repititions.
Grouping and Backreferences
 Round brackets besides grouping part of a regular expression
together, also create a "backreference". A backreference stores
the matching part of the string matched by the part of the regular
expression inside the parentheses. For e.g.
 ([0-9])1+ will match 222 but not 837.
 If backreference are not required, you can optimize this regular
expression Set(?:Value)?
 Backreferences can be used in expressions itself or in
replacement text. For e.g.
 <([A-Za-z][A-Za-z0-9]*)>.*</1> will match matching opening
and closing tags.
Unicode characters in Regular Exp.
 Unicode characters can be used as uxxxx in regular expressions.
For e.g.
 ‫عطاری‬ cat be matched in an expression as:
u0639u0637u0627u0631u06cc
Regular Exp. Matching Modes
 /i makes the regex match case insensitive.
 [A-Z] will match A and a with this modifier.
 /s enables "single-line mode". In this mode, the dot matches newlines as well.
 .* will match sherazrnattari with this modifier.
 /m enables "multi-line mode". In this mode, the caret and dollar match before
and after newlines in the subject string.
 .* will match only sheraz in sherazrnattari with this modifier.
 /x enables "free-spacing mode". In this mode, whitespace between regex
tokens is ignored, and an unescaped # starts a comment.
 #sherazrnrn.* will match only sheraz in with this modifier.
Lookarounds with Conditions…
 A conditional is a special construct that will first evaluate a lookaround, and
then execute one sub-regex if the lookaround succeeds, and another sub-
regex if the lookaround fails.
 Example of Positive lookahead is:
 q(?=uv*) will match q in quvvvv and qu.
 Example of Negative lookahead is:
 q(?!uv*) will match q not followed by u and uv.
 Example of Positive lookbehind is:
 (?<=b)a will match a prefixed by b like ba.
 Example of Negative lookbehind is:
 (?<!b)a will match a not prefixed by b like ca and da etc.
Contact
 For more details about our
services, please get in touch with
us.
contact@folio3.com
US Office: (408) 365-4638
www.folio3.com
Ad

More Related Content

What's hot (20)

2013 - Andrei Zmievski: Clínica Regex
2013 - Andrei Zmievski: Clínica Regex2013 - Andrei Zmievski: Clínica Regex
2013 - Andrei Zmievski: Clínica Regex
PHP Conference Argentina
 
Introduction to regular expressions
Introduction to regular expressionsIntroduction to regular expressions
Introduction to regular expressions
Ben Brumfield
 
Finaal application on regular expression
Finaal application on regular expressionFinaal application on regular expression
Finaal application on regular expression
Gagan019
 
Bioinformatica p2-p3-introduction
Bioinformatica p2-p3-introductionBioinformatica p2-p3-introduction
Bioinformatica p2-p3-introduction
Prof. Wim Van Criekinge
 
Regular expressions in oracle
Regular expressions in oracleRegular expressions in oracle
Regular expressions in oracle
Logan Palanisamy
 
Regular expressions
Regular expressionsRegular expressions
Regular expressions
Raj Gupta
 
Regular Expression
Regular ExpressionRegular Expression
Regular Expression
Mahzad Zahedi
 
Regular Expressions grep and egrep
Regular Expressions grep and egrepRegular Expressions grep and egrep
Regular Expressions grep and egrep
Tri Truong
 
Regular expressions in Ruby and Introduction to Vim
Regular expressions in Ruby and Introduction to VimRegular expressions in Ruby and Introduction to Vim
Regular expressions in Ruby and Introduction to Vim
Stalin Thangaraj
 
Regular Expression
Regular ExpressionRegular Expression
Regular Expression
Lambert Lum
 
Regex Presentation
Regex PresentationRegex Presentation
Regex Presentation
arnolambert
 
Patterns
PatternsPatterns
Patterns
Gayathri91098
 
Php String And Regular Expressions
Php String  And Regular ExpressionsPhp String  And Regular Expressions
Php String And Regular Expressions
mussawir20
 
Regular Expressions
Regular ExpressionsRegular Expressions
Regular Expressions
Satya Narayana
 
Java: Regular Expression
Java: Regular ExpressionJava: Regular Expression
Java: Regular Expression
Masudul Haque
 
Regular Expressions 2007
Regular Expressions 2007Regular Expressions 2007
Regular Expressions 2007
Geoffrey Dunn
 
Regular Expressions 101 Introduction to Regular Expressions
Regular Expressions 101 Introduction to Regular ExpressionsRegular Expressions 101 Introduction to Regular Expressions
Regular Expressions 101 Introduction to Regular Expressions
Danny Bryant
 
16 Java Regex
16 Java Regex16 Java Regex
16 Java Regex
wayn
 
Regular expression
Regular expressionRegular expression
Regular expression
Larry Nung
 
Regular Expression (Regex) Fundamentals
Regular Expression (Regex) FundamentalsRegular Expression (Regex) Fundamentals
Regular Expression (Regex) Fundamentals
Mesut Günes
 
Introduction to regular expressions
Introduction to regular expressionsIntroduction to regular expressions
Introduction to regular expressions
Ben Brumfield
 
Finaal application on regular expression
Finaal application on regular expressionFinaal application on regular expression
Finaal application on regular expression
Gagan019
 
Regular expressions in oracle
Regular expressions in oracleRegular expressions in oracle
Regular expressions in oracle
Logan Palanisamy
 
Regular expressions
Regular expressionsRegular expressions
Regular expressions
Raj Gupta
 
Regular Expressions grep and egrep
Regular Expressions grep and egrepRegular Expressions grep and egrep
Regular Expressions grep and egrep
Tri Truong
 
Regular expressions in Ruby and Introduction to Vim
Regular expressions in Ruby and Introduction to VimRegular expressions in Ruby and Introduction to Vim
Regular expressions in Ruby and Introduction to Vim
Stalin Thangaraj
 
Regular Expression
Regular ExpressionRegular Expression
Regular Expression
Lambert Lum
 
Regex Presentation
Regex PresentationRegex Presentation
Regex Presentation
arnolambert
 
Php String And Regular Expressions
Php String  And Regular ExpressionsPhp String  And Regular Expressions
Php String And Regular Expressions
mussawir20
 
Java: Regular Expression
Java: Regular ExpressionJava: Regular Expression
Java: Regular Expression
Masudul Haque
 
Regular Expressions 2007
Regular Expressions 2007Regular Expressions 2007
Regular Expressions 2007
Geoffrey Dunn
 
Regular Expressions 101 Introduction to Regular Expressions
Regular Expressions 101 Introduction to Regular ExpressionsRegular Expressions 101 Introduction to Regular Expressions
Regular Expressions 101 Introduction to Regular Expressions
Danny Bryant
 
16 Java Regex
16 Java Regex16 Java Regex
16 Java Regex
wayn
 
Regular expression
Regular expressionRegular expression
Regular expression
Larry Nung
 
Regular Expression (Regex) Fundamentals
Regular Expression (Regex) FundamentalsRegular Expression (Regex) Fundamentals
Regular Expression (Regex) Fundamentals
Mesut Günes
 

Similar to Regular Expression in Action (20)

Regular Expression Crash Course
Regular Expression Crash CourseRegular Expression Crash Course
Regular Expression Crash Course
Imran Qasim
 
Regular expressions
Regular expressionsRegular expressions
Regular expressions
Raghu nath
 
Regex lecture
Regex lectureRegex lecture
Regex lecture
Jun Shimizu
 
Regular Expression Cheat Sheet
Regular Expression Cheat SheetRegular Expression Cheat Sheet
Regular Expression Cheat Sheet
SydneyJohnson57
 
Strings,patterns and regular expressions in perl
Strings,patterns and regular expressions in perlStrings,patterns and regular expressions in perl
Strings,patterns and regular expressions in perl
sana mateen
 
Unit 1-strings,patterns and regular expressions
Unit 1-strings,patterns and regular expressionsUnit 1-strings,patterns and regular expressions
Unit 1-strings,patterns and regular expressions
sana mateen
 
/Regex makes me want to (weep_give up_(╯°□°)╯︵ ┻━┻)/i (for 2024 CascadiaPHP)
/Regex makes me want to (weep_give up_(╯°□°)╯︵ ┻━┻)/i (for 2024 CascadiaPHP)/Regex makes me want to (weep_give up_(╯°□°)╯︵ ┻━┻)/i (for 2024 CascadiaPHP)
/Regex makes me want to (weep_give up_(╯°□°)╯︵ ┻━┻)/i (for 2024 CascadiaPHP)
brettflorio
 
2.regular expressions
2.regular expressions2.regular expressions
2.regular expressions
Praveen Gorantla
 
Regex startup
Regex startupRegex startup
Regex startup
PayPal
 
Regular expressions
Regular expressionsRegular expressions
Regular expressions
keeyre
 
Regular Expressions and You
Regular Expressions and YouRegular Expressions and You
Regular Expressions and You
James Armes
 
Regular Expressions in Google Analytics
Regular Expressions in Google AnalyticsRegular Expressions in Google Analytics
Regular Expressions in Google Analytics
Shivani Singh
 
Python - Regular Expressions
Python - Regular ExpressionsPython - Regular Expressions
Python - Regular Expressions
Mukesh Tekwani
 
REGULAR EXPRESSION FOR NATURAL LANGUAGES
REGULAR EXPRESSION FOR NATURAL LANGUAGESREGULAR EXPRESSION FOR NATURAL LANGUAGES
REGULAR EXPRESSION FOR NATURAL LANGUAGES
ssuser77162c
 
Maxbox starter20
Maxbox starter20Maxbox starter20
Maxbox starter20
Max Kleiner
 
Introduction_to_Regular_Expressions_in_R
Introduction_to_Regular_Expressions_in_RIntroduction_to_Regular_Expressions_in_R
Introduction_to_Regular_Expressions_in_R
Hellen Gakuruh
 
Adv. python regular expression by Rj
Adv. python regular expression by RjAdv. python regular expression by Rj
Adv. python regular expression by Rj
Shree M.L.Kakadiya MCA mahila college, Amreli
 
Lecture 18 - Regular Expressions.pdf
Lecture 18 - Regular Expressions.pdfLecture 18 - Regular Expressions.pdf
Lecture 18 - Regular Expressions.pdf
Saravana Kumar
 
Bioinformatica 06-10-2011-p2 introduction
Bioinformatica 06-10-2011-p2 introductionBioinformatica 06-10-2011-p2 introduction
Bioinformatica 06-10-2011-p2 introduction
Prof. Wim Van Criekinge
 
And now you have two problems. Ruby regular expressions for fun and profit by...
And now you have two problems. Ruby regular expressions for fun and profit by...And now you have two problems. Ruby regular expressions for fun and profit by...
And now you have two problems. Ruby regular expressions for fun and profit by...
Codemotion
 
Regular Expression Crash Course
Regular Expression Crash CourseRegular Expression Crash Course
Regular Expression Crash Course
Imran Qasim
 
Regular expressions
Regular expressionsRegular expressions
Regular expressions
Raghu nath
 
Regular Expression Cheat Sheet
Regular Expression Cheat SheetRegular Expression Cheat Sheet
Regular Expression Cheat Sheet
SydneyJohnson57
 
Strings,patterns and regular expressions in perl
Strings,patterns and regular expressions in perlStrings,patterns and regular expressions in perl
Strings,patterns and regular expressions in perl
sana mateen
 
Unit 1-strings,patterns and regular expressions
Unit 1-strings,patterns and regular expressionsUnit 1-strings,patterns and regular expressions
Unit 1-strings,patterns and regular expressions
sana mateen
 
/Regex makes me want to (weep_give up_(╯°□°)╯︵ ┻━┻)/i (for 2024 CascadiaPHP)
/Regex makes me want to (weep_give up_(╯°□°)╯︵ ┻━┻)/i (for 2024 CascadiaPHP)/Regex makes me want to (weep_give up_(╯°□°)╯︵ ┻━┻)/i (for 2024 CascadiaPHP)
/Regex makes me want to (weep_give up_(╯°□°)╯︵ ┻━┻)/i (for 2024 CascadiaPHP)
brettflorio
 
Regex startup
Regex startupRegex startup
Regex startup
PayPal
 
Regular expressions
Regular expressionsRegular expressions
Regular expressions
keeyre
 
Regular Expressions and You
Regular Expressions and YouRegular Expressions and You
Regular Expressions and You
James Armes
 
Regular Expressions in Google Analytics
Regular Expressions in Google AnalyticsRegular Expressions in Google Analytics
Regular Expressions in Google Analytics
Shivani Singh
 
Python - Regular Expressions
Python - Regular ExpressionsPython - Regular Expressions
Python - Regular Expressions
Mukesh Tekwani
 
REGULAR EXPRESSION FOR NATURAL LANGUAGES
REGULAR EXPRESSION FOR NATURAL LANGUAGESREGULAR EXPRESSION FOR NATURAL LANGUAGES
REGULAR EXPRESSION FOR NATURAL LANGUAGES
ssuser77162c
 
Maxbox starter20
Maxbox starter20Maxbox starter20
Maxbox starter20
Max Kleiner
 
Introduction_to_Regular_Expressions_in_R
Introduction_to_Regular_Expressions_in_RIntroduction_to_Regular_Expressions_in_R
Introduction_to_Regular_Expressions_in_R
Hellen Gakuruh
 
Lecture 18 - Regular Expressions.pdf
Lecture 18 - Regular Expressions.pdfLecture 18 - Regular Expressions.pdf
Lecture 18 - Regular Expressions.pdf
Saravana Kumar
 
Bioinformatica 06-10-2011-p2 introduction
Bioinformatica 06-10-2011-p2 introductionBioinformatica 06-10-2011-p2 introduction
Bioinformatica 06-10-2011-p2 introduction
Prof. Wim Van Criekinge
 
And now you have two problems. Ruby regular expressions for fun and profit by...
And now you have two problems. Ruby regular expressions for fun and profit by...And now you have two problems. Ruby regular expressions for fun and profit by...
And now you have two problems. Ruby regular expressions for fun and profit by...
Codemotion
 
Ad

More from Folio3 Software (20)

Shopify & Shopify Plus Ecommerce Development Experts
Shopify & Shopify Plus Ecommerce Development Experts Shopify & Shopify Plus Ecommerce Development Experts
Shopify & Shopify Plus Ecommerce Development Experts
Folio3 Software
 
Magento and Magento 2 Ecommerce Development
Magento and Magento 2 Ecommerce Development Magento and Magento 2 Ecommerce Development
Magento and Magento 2 Ecommerce Development
Folio3 Software
 
All You Need to Know About Type Script
All You Need to Know About Type ScriptAll You Need to Know About Type Script
All You Need to Know About Type Script
Folio3 Software
 
Enter the Big Picture
Enter the Big PictureEnter the Big Picture
Enter the Big Picture
Folio3 Software
 
A Guideline to Test Your Own Code - Developer Testing
A Guideline to Test Your Own Code - Developer TestingA Guideline to Test Your Own Code - Developer Testing
A Guideline to Test Your Own Code - Developer Testing
Folio3 Software
 
OWIN (Open Web Interface for .NET)
OWIN (Open Web Interface for .NET)OWIN (Open Web Interface for .NET)
OWIN (Open Web Interface for .NET)
Folio3 Software
 
Introduction to Go-Lang
Introduction to Go-LangIntroduction to Go-Lang
Introduction to Go-Lang
Folio3 Software
 
An Introduction to CSS Preprocessors (SASS & LESS)
An Introduction to CSS Preprocessors (SASS & LESS)An Introduction to CSS Preprocessors (SASS & LESS)
An Introduction to CSS Preprocessors (SASS & LESS)
Folio3 Software
 
Introduction to SharePoint 2013
Introduction to SharePoint 2013Introduction to SharePoint 2013
Introduction to SharePoint 2013
Folio3 Software
 
An Overview of Blackberry 10
An Overview of Blackberry 10An Overview of Blackberry 10
An Overview of Blackberry 10
Folio3 Software
 
StackOverflow Architectural Overview
StackOverflow Architectural OverviewStackOverflow Architectural Overview
StackOverflow Architectural Overview
Folio3 Software
 
Enterprise Mobility - An Introduction
Enterprise Mobility - An IntroductionEnterprise Mobility - An Introduction
Enterprise Mobility - An Introduction
Folio3 Software
 
Distributed and Fault Tolerant Realtime Computation with Apache Storm, Apache...
Distributed and Fault Tolerant Realtime Computation with Apache Storm, Apache...Distributed and Fault Tolerant Realtime Computation with Apache Storm, Apache...
Distributed and Fault Tolerant Realtime Computation with Apache Storm, Apache...
Folio3 Software
 
Introduction to Docker
Introduction to DockerIntroduction to Docker
Introduction to Docker
Folio3 Software
 
Introduction to Enterprise Service Bus
Introduction to Enterprise Service BusIntroduction to Enterprise Service Bus
Introduction to Enterprise Service Bus
Folio3 Software
 
NOSQL Database: Apache Cassandra
NOSQL Database: Apache CassandraNOSQL Database: Apache Cassandra
NOSQL Database: Apache Cassandra
Folio3 Software
 
HTTP Server Push Techniques
HTTP Server Push TechniquesHTTP Server Push Techniques
HTTP Server Push Techniques
Folio3 Software
 
Best Practices of Software Development
Best Practices of Software DevelopmentBest Practices of Software Development
Best Practices of Software Development
Folio3 Software
 
Offline Data Access in Enterprise Mobility
Offline Data Access in Enterprise MobilityOffline Data Access in Enterprise Mobility
Offline Data Access in Enterprise Mobility
Folio3 Software
 
Realtime and Synchronous Applications
Realtime and Synchronous ApplicationsRealtime and Synchronous Applications
Realtime and Synchronous Applications
Folio3 Software
 
Shopify & Shopify Plus Ecommerce Development Experts
Shopify & Shopify Plus Ecommerce Development Experts Shopify & Shopify Plus Ecommerce Development Experts
Shopify & Shopify Plus Ecommerce Development Experts
Folio3 Software
 
Magento and Magento 2 Ecommerce Development
Magento and Magento 2 Ecommerce Development Magento and Magento 2 Ecommerce Development
Magento and Magento 2 Ecommerce Development
Folio3 Software
 
All You Need to Know About Type Script
All You Need to Know About Type ScriptAll You Need to Know About Type Script
All You Need to Know About Type Script
Folio3 Software
 
A Guideline to Test Your Own Code - Developer Testing
A Guideline to Test Your Own Code - Developer TestingA Guideline to Test Your Own Code - Developer Testing
A Guideline to Test Your Own Code - Developer Testing
Folio3 Software
 
OWIN (Open Web Interface for .NET)
OWIN (Open Web Interface for .NET)OWIN (Open Web Interface for .NET)
OWIN (Open Web Interface for .NET)
Folio3 Software
 
An Introduction to CSS Preprocessors (SASS & LESS)
An Introduction to CSS Preprocessors (SASS & LESS)An Introduction to CSS Preprocessors (SASS & LESS)
An Introduction to CSS Preprocessors (SASS & LESS)
Folio3 Software
 
Introduction to SharePoint 2013
Introduction to SharePoint 2013Introduction to SharePoint 2013
Introduction to SharePoint 2013
Folio3 Software
 
An Overview of Blackberry 10
An Overview of Blackberry 10An Overview of Blackberry 10
An Overview of Blackberry 10
Folio3 Software
 
StackOverflow Architectural Overview
StackOverflow Architectural OverviewStackOverflow Architectural Overview
StackOverflow Architectural Overview
Folio3 Software
 
Enterprise Mobility - An Introduction
Enterprise Mobility - An IntroductionEnterprise Mobility - An Introduction
Enterprise Mobility - An Introduction
Folio3 Software
 
Distributed and Fault Tolerant Realtime Computation with Apache Storm, Apache...
Distributed and Fault Tolerant Realtime Computation with Apache Storm, Apache...Distributed and Fault Tolerant Realtime Computation with Apache Storm, Apache...
Distributed and Fault Tolerant Realtime Computation with Apache Storm, Apache...
Folio3 Software
 
Introduction to Enterprise Service Bus
Introduction to Enterprise Service BusIntroduction to Enterprise Service Bus
Introduction to Enterprise Service Bus
Folio3 Software
 
NOSQL Database: Apache Cassandra
NOSQL Database: Apache CassandraNOSQL Database: Apache Cassandra
NOSQL Database: Apache Cassandra
Folio3 Software
 
HTTP Server Push Techniques
HTTP Server Push TechniquesHTTP Server Push Techniques
HTTP Server Push Techniques
Folio3 Software
 
Best Practices of Software Development
Best Practices of Software DevelopmentBest Practices of Software Development
Best Practices of Software Development
Folio3 Software
 
Offline Data Access in Enterprise Mobility
Offline Data Access in Enterprise MobilityOffline Data Access in Enterprise Mobility
Offline Data Access in Enterprise Mobility
Folio3 Software
 
Realtime and Synchronous Applications
Realtime and Synchronous ApplicationsRealtime and Synchronous Applications
Realtime and Synchronous Applications
Folio3 Software
 
Ad

Recently uploaded (20)

Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep DiveDesigning Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
ScyllaDB
 
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
SOFTTECHHUB
 
Rusty Waters: Elevating Lakehouses Beyond Spark
Rusty Waters: Elevating Lakehouses Beyond SparkRusty Waters: Elevating Lakehouses Beyond Spark
Rusty Waters: Elevating Lakehouses Beyond Spark
carlyakerly1
 
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul
 
Generative Artificial Intelligence (GenAI) in Business
Generative Artificial Intelligence (GenAI) in BusinessGenerative Artificial Intelligence (GenAI) in Business
Generative Artificial Intelligence (GenAI) in Business
Dr. Tathagat Varma
 
How Can I use the AI Hype in my Business Context?
How Can I use the AI Hype in my Business Context?How Can I use the AI Hype in my Business Context?
How Can I use the AI Hype in my Business Context?
Daniel Lehner
 
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
Alan Dix
 
Complete Guide to Advanced Logistics Management Software in Riyadh.pdf
Complete Guide to Advanced Logistics Management Software in Riyadh.pdfComplete Guide to Advanced Logistics Management Software in Riyadh.pdf
Complete Guide to Advanced Logistics Management Software in Riyadh.pdf
Software Company
 
Drupalcamp Finland – Measuring Front-end Energy Consumption
Drupalcamp Finland – Measuring Front-end Energy ConsumptionDrupalcamp Finland – Measuring Front-end Energy Consumption
Drupalcamp Finland – Measuring Front-end Energy Consumption
Exove
 
IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...
IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...
IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...
organizerofv
 
Dev Dives: Automate and orchestrate your processes with UiPath Maestro
Dev Dives: Automate and orchestrate your processes with UiPath MaestroDev Dives: Automate and orchestrate your processes with UiPath Maestro
Dev Dives: Automate and orchestrate your processes with UiPath Maestro
UiPathCommunity
 
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
BookNet Canada
 
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdfSAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
Precisely
 
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In France
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In FranceManifest Pre-Seed Update | A Humanoid OEM Deeptech In France
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In France
chb3
 
Build Your Own Copilot & Agents For Devs
Build Your Own Copilot & Agents For DevsBuild Your Own Copilot & Agents For Devs
Build Your Own Copilot & Agents For Devs
Brian McKeiver
 
Role of Data Annotation Services in AI-Powered Manufacturing
Role of Data Annotation Services in AI-Powered ManufacturingRole of Data Annotation Services in AI-Powered Manufacturing
Role of Data Annotation Services in AI-Powered Manufacturing
Andrew Leo
 
Splunk Security Update | Public Sector Summit Germany 2025
Splunk Security Update | Public Sector Summit Germany 2025Splunk Security Update | Public Sector Summit Germany 2025
Splunk Security Update | Public Sector Summit Germany 2025
Splunk
 
Mobile App Development Company in Saudi Arabia
Mobile App Development Company in Saudi ArabiaMobile App Development Company in Saudi Arabia
Mobile App Development Company in Saudi Arabia
Steve Jonas
 
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdfThe Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
Abi john
 
What is Model Context Protocol(MCP) - The new technology for communication bw...
What is Model Context Protocol(MCP) - The new technology for communication bw...What is Model Context Protocol(MCP) - The new technology for communication bw...
What is Model Context Protocol(MCP) - The new technology for communication bw...
Vishnu Singh Chundawat
 
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep DiveDesigning Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
ScyllaDB
 
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
SOFTTECHHUB
 
Rusty Waters: Elevating Lakehouses Beyond Spark
Rusty Waters: Elevating Lakehouses Beyond SparkRusty Waters: Elevating Lakehouses Beyond Spark
Rusty Waters: Elevating Lakehouses Beyond Spark
carlyakerly1
 
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul
 
Generative Artificial Intelligence (GenAI) in Business
Generative Artificial Intelligence (GenAI) in BusinessGenerative Artificial Intelligence (GenAI) in Business
Generative Artificial Intelligence (GenAI) in Business
Dr. Tathagat Varma
 
How Can I use the AI Hype in my Business Context?
How Can I use the AI Hype in my Business Context?How Can I use the AI Hype in my Business Context?
How Can I use the AI Hype in my Business Context?
Daniel Lehner
 
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
Alan Dix
 
Complete Guide to Advanced Logistics Management Software in Riyadh.pdf
Complete Guide to Advanced Logistics Management Software in Riyadh.pdfComplete Guide to Advanced Logistics Management Software in Riyadh.pdf
Complete Guide to Advanced Logistics Management Software in Riyadh.pdf
Software Company
 
Drupalcamp Finland – Measuring Front-end Energy Consumption
Drupalcamp Finland – Measuring Front-end Energy ConsumptionDrupalcamp Finland – Measuring Front-end Energy Consumption
Drupalcamp Finland – Measuring Front-end Energy Consumption
Exove
 
IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...
IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...
IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...
organizerofv
 
Dev Dives: Automate and orchestrate your processes with UiPath Maestro
Dev Dives: Automate and orchestrate your processes with UiPath MaestroDev Dives: Automate and orchestrate your processes with UiPath Maestro
Dev Dives: Automate and orchestrate your processes with UiPath Maestro
UiPathCommunity
 
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
BookNet Canada
 
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdfSAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
Precisely
 
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In France
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In FranceManifest Pre-Seed Update | A Humanoid OEM Deeptech In France
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In France
chb3
 
Build Your Own Copilot & Agents For Devs
Build Your Own Copilot & Agents For DevsBuild Your Own Copilot & Agents For Devs
Build Your Own Copilot & Agents For Devs
Brian McKeiver
 
Role of Data Annotation Services in AI-Powered Manufacturing
Role of Data Annotation Services in AI-Powered ManufacturingRole of Data Annotation Services in AI-Powered Manufacturing
Role of Data Annotation Services in AI-Powered Manufacturing
Andrew Leo
 
Splunk Security Update | Public Sector Summit Germany 2025
Splunk Security Update | Public Sector Summit Germany 2025Splunk Security Update | Public Sector Summit Germany 2025
Splunk Security Update | Public Sector Summit Germany 2025
Splunk
 
Mobile App Development Company in Saudi Arabia
Mobile App Development Company in Saudi ArabiaMobile App Development Company in Saudi Arabia
Mobile App Development Company in Saudi Arabia
Steve Jonas
 
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdfThe Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
Abi john
 
What is Model Context Protocol(MCP) - The new technology for communication bw...
What is Model Context Protocol(MCP) - The new technology for communication bw...What is Model Context Protocol(MCP) - The new technology for communication bw...
What is Model Context Protocol(MCP) - The new technology for communication bw...
Vishnu Singh Chundawat
 

Regular Expression in Action

  • 1. Regular Expression inRegular Expression in ActionAction www.folio3.com@folio_3
  • 2. Folio3 – OverviewFolio3 – Overview www.folio3.com @folio_3
  • 3. Who We Are  We are a Development Partner for our customers  Design software solutions, not just implement them  Focus on the solution – Platform and technology agnostic  Expertise in building applications that are: Mobile Social Cloud-based Gamified
  • 4. What We Do  Areas of Focus  Enterprise  Custom enterprise applications  Product development targeting the enterprise  Mobile  Custom mobile apps for iOS, Android, Windows Phone, BB OS  Mobile platform (server-to-server) development  Social Media  CMS based websites for consumers and enterprise (corporate, consumer, community & social networking)  Social media platform development (enterprise & consumer)
  • 5. Folio3 At a Glance  Founded in 2005  Over 200 full time employees  Offices in the US, Canada, Bulgaria & Pakistan  Palo Alto, CA.  Sofia, Bulgaria  Karachi, Pakistan Toronto, Canada
  • 6. Areas of Focus: Enterprise  Automating workflows  Cloud based solutions  Application integration  Platform development  Healthcare  Mobile Enterprise  Digital Media  Supply Chain
  • 7. Some of Our Enterprise Clients
  • 8. Areas of Focus: Mobile  Serious enterprise applications for Banks, Businesses  Fun consumer apps for app discovery, interaction, exercise gamification and play  Educational apps  Augmented Reality apps  Mobile Platforms
  • 9. Some of Our Mobile Clients
  • 10. Areas of Focus: Web & Social Media  Community Sites based on Content Management Systems  Enterprise Social Networking  Social Games for Facebook & Mobile  Companion Apps for games
  • 11. Some of Our Web Clients
  • 12. Regular Expression inRegular Expression in ActionAction www.folio3.com @folio_3
  • 13. Agenda  What are Regular Expressions  Literal characters and Special characters  Build blocks of Regular Expressions  Grouping and Backreferences  Unicode characters in regular expressions  Regex Matching Modes  Lookarounds  Parse a log file…
  • 14. What are Regular Expressions?  Regular expressions provide a concise and flexible means for matching strings of text, such as particular characters, words, or patterns of characters.
  • 15. Literal and Special characters  The most basic regular expression consists of a literal which behaves just like string matching. For e.g.  cat will match cat in About cats and dogs.  Special characters known as meta characters needs to be escaped with a in regular expressions if they are used as part of a literal:  dogs. will match dogs. in About cats and dogs.  Meta characters are:  [ ^ $ . | ? * + ( ) {
  • 16. Character Classes and Shorthands  With a "character class", also called "character set", you can tell the regex engine to match only one out of several characters. For e.g.  gr[ae]y will match grey and gray both.  Ranges can be specified using dash. For e.g.  [0-9] will match any digit from 0 to 9.  [0-9a-fA-F] will match any single hexadecimal digit.  Caret after the opening square bracket will negate the character class. The result is that the character class will match any character that is not in the character class. For e.g.  [^0-9] will match any thing except number.  q[^u] will not match Iraq but it will match Iraq is a country
  • 17. Character Classes and Shorthands  Meta characters works fine without escaping in Character classes. For e.g.  [+*] is a valid expression and match either * or +.  There are some pre-defined character classes known as short hand character classes:  w stands for [A-Za-z0-9_]  s stands for [ trn]  d stands for [0-9]  If a character class is repeated by using the ?, * or + operators, the entire character class will be repeated, and not just the character that it matched. For e.g.  [0-9]+ can match 837 as well as 222  ([0-9])1+ will match 222 but not 837.
  • 18. Building blocks of Regular Exp.  The famous dot “.” operator matches anything. For e.g.  a.b will match abb, aab, a+b etc.  ^ and $ are used to match start and end of regular expressions. For e.g.  ^My.*.$ will match anything starting with My and ending with a dot.  Pipe operator is used to match a string against either its left or the right part. For e.g.  (cat|dog) can match both cat or dog.  Question:  If the expression is Get|GetValue|Set|SetValue and string is SetValue. What will this match and why?  What if the expression becomes Get(Value)?|Set(Value)?  * or {0,} and + or {1,} are used to control repititions.
  • 19. Grouping and Backreferences  Round brackets besides grouping part of a regular expression together, also create a "backreference". A backreference stores the matching part of the string matched by the part of the regular expression inside the parentheses. For e.g.  ([0-9])1+ will match 222 but not 837.  If backreference are not required, you can optimize this regular expression Set(?:Value)?  Backreferences can be used in expressions itself or in replacement text. For e.g.  <([A-Za-z][A-Za-z0-9]*)>.*</1> will match matching opening and closing tags.
  • 20. Unicode characters in Regular Exp.  Unicode characters can be used as uxxxx in regular expressions. For e.g.  ‫عطاری‬ cat be matched in an expression as: u0639u0637u0627u0631u06cc
  • 21. Regular Exp. Matching Modes  /i makes the regex match case insensitive.  [A-Z] will match A and a with this modifier.  /s enables "single-line mode". In this mode, the dot matches newlines as well.  .* will match sherazrnattari with this modifier.  /m enables "multi-line mode". In this mode, the caret and dollar match before and after newlines in the subject string.  .* will match only sheraz in sherazrnattari with this modifier.  /x enables "free-spacing mode". In this mode, whitespace between regex tokens is ignored, and an unescaped # starts a comment.  #sherazrnrn.* will match only sheraz in with this modifier.
  • 22. Lookarounds with Conditions…  A conditional is a special construct that will first evaluate a lookaround, and then execute one sub-regex if the lookaround succeeds, and another sub- regex if the lookaround fails.  Example of Positive lookahead is:  q(?=uv*) will match q in quvvvv and qu.  Example of Negative lookahead is:  q(?!uv*) will match q not followed by u and uv.  Example of Positive lookbehind is:  (?<=b)a will match a prefixed by b like ba.  Example of Negative lookbehind is:  (?<!b)a will match a not prefixed by b like ca and da etc.
  • 23. Contact  For more details about our services, please get in touch with us. [email protected] US Office: (408) 365-4638 www.folio3.com