SlideShare a Scribd company logo
Copyright © 2017, edureka and/or its affiliates. All rights reserved.
JAVASCRIPT REGEX
MODIFIERS
BRACKETS
www.edureka.co
METACHARACTERS
QUANTIFIERS
OBJECT PROPERTIES
OBJECT METHODS
www.edureka.co
A Regular Expression is a sequence of characters that constructs a search pattern. When you search for data in a text,
you can use this search pattern to describe what you are looking for.
What are Regular Expressions?
www.edureka.co
www.edureka.co
g It performs a global match
i It performs case-insensitive matching
m It performs multiline matching
www.edureka.co
www.edureka.co
[abc] Finds any character between the brackets
[^abc] Finds any character NOT between the brackets
[0-9] Finds any digit between the brackets
[^0-9] Finds any non-digit NOT between the brackets
www.edureka.co
www.edureka.co
w It looks for a word character
W It finds a non-word character
d It finds a digit
D It finds a non-digit Character
s It finds a whitespace character
S It finds a non-whitespace character
b It finds a match at the beginning/end of a word
B It looks for a match, but not at the beginning/end of a word
f It finds a form feed character
r It finds a carriage return character
v It finds a vertical tab character
t It finds a tab character
www.edureka.co
www.edureka.co
n+ It matches any string that contains at least one n
n* It matches any string that contains zero or more occurrences of n
n? It matches any string that contains zero or one occurrence of n
n{X} It matches any string that contains a sequence of X n’s
n{X,Y} It matches any string that contains a sequence of X to Y n’s
n{X,} It matches any string that contains a sequence of at least X n’s
n$ It matches any string with n at the end of it
www.edureka.co
www.edureka.co
Constructor Returns the function that creates the RegExp object’s prototype
global Checks whether the “g” modifier is set
ignoreCase Checks whether the “i” modifier is set
lastIndex Specifies the index at which to start the next match
multiline Checks whether the “m” modifier is set
www.edureka.co
www.edureka.co
Compile() It compiles a regular expression
exec() It tests for a match in a string and returns the first match
test() It tests for a match in a string and returns true or false
toString() It returns the string value of the regular expression
www.edureka.co
Copyright © 2017, edureka and/or its affiliates. All rights reserved.
www.edureka.co
www.edureka.co

More Related Content

PPT
RegEx : Expressions and Parsing Examples
zeteo12
 
PPTX
R data types
Teachers Mitraa
 
PDF
JavaScript - Chapter 9 - TypeConversion and Regular Expressions
WebStackAcademy
 
PPTX
Regular expression unit2
smitha273566
 
PPT
Regular expressions
Raj Gupta
 
PPTX
Regex lecture
Jun Shimizu
 
PDF
FUNDAMENTALS OF REGULAR EXPRESSION (RegEX).pdf
Bryan Alejos
 
PDF
3.2 javascript regex
Jalpesh Vasa
 
RegEx : Expressions and Parsing Examples
zeteo12
 
R data types
Teachers Mitraa
 
JavaScript - Chapter 9 - TypeConversion and Regular Expressions
WebStackAcademy
 
Regular expression unit2
smitha273566
 
Regular expressions
Raj Gupta
 
Regex lecture
Jun Shimizu
 
FUNDAMENTALS OF REGULAR EXPRESSION (RegEX).pdf
Bryan Alejos
 
3.2 javascript regex
Jalpesh Vasa
 

Similar to What is JavaScript Regex | Regular Expressions in JavaScript | Edureka (20)

PDF
Coffee 'n code: Regexes
Phil Ewels
 
PDF
Regular Expressions: JavaScript And Beyond
Max Shirshin
 
PDF
Practical JavaScript Programming - Session 6/8
Wilson Su
 
PPT
regular-expressions lecture 28-string regular expression
smallboss311
 
PDF
Construction of a predictive parsing table.pdf
anwarkade1
 
PPTX
Regular Expression Crash Course
Imran Qasim
 
PPTX
Pattern matching using regular expression
sdmanjula51
 
PPT
Regular Expression in Action
Folio3 Software
 
PPTX
REGULAR EXPRESSION FOR NATURAL LANGUAGES
ssuser77162c
 
PPTX
Regular Expressions(Theory of programming languages))
khudabux1998
 
PPTX
Regular Expressions Introduction Anthony Rudd CS
gapati2964
 
PPT
Chapter-three automata and complexity theory.ppt
anwarkade1
 
ODP
CiNPA Security SIG - Regex Presentation
ThreatReel Podcast
 
PDF
Regular expressions
ssuser8779cd
 
PPT
Adv. python regular expression by Rj
Shree M.L.Kakadiya MCA mahila college, Amreli
 
ODP
DerbyCon 7.0 Legacy: Regular Expressions (Regex) Overview
ThreatReel Podcast
 
ODP
OISF: Regular Expressions (Regex) Overview
ThreatReel Podcast
 
PDF
An Introduction to Regular expressions
Yamagata Europe
 
PPTX
Regular expressions
Ивелин Кирилов
 
PDF
Introduction_to_Regular_Expressions_in_R
Hellen Gakuruh
 
Coffee 'n code: Regexes
Phil Ewels
 
Regular Expressions: JavaScript And Beyond
Max Shirshin
 
Practical JavaScript Programming - Session 6/8
Wilson Su
 
regular-expressions lecture 28-string regular expression
smallboss311
 
Construction of a predictive parsing table.pdf
anwarkade1
 
Regular Expression Crash Course
Imran Qasim
 
Pattern matching using regular expression
sdmanjula51
 
Regular Expression in Action
Folio3 Software
 
REGULAR EXPRESSION FOR NATURAL LANGUAGES
ssuser77162c
 
Regular Expressions(Theory of programming languages))
khudabux1998
 
Regular Expressions Introduction Anthony Rudd CS
gapati2964
 
Chapter-three automata and complexity theory.ppt
anwarkade1
 
CiNPA Security SIG - Regex Presentation
ThreatReel Podcast
 
Regular expressions
ssuser8779cd
 
Adv. python regular expression by Rj
Shree M.L.Kakadiya MCA mahila college, Amreli
 
DerbyCon 7.0 Legacy: Regular Expressions (Regex) Overview
ThreatReel Podcast
 
OISF: Regular Expressions (Regex) Overview
ThreatReel Podcast
 
An Introduction to Regular expressions
Yamagata Europe
 
Regular expressions
Ивелин Кирилов
 
Introduction_to_Regular_Expressions_in_R
Hellen Gakuruh
 
Ad

More from Edureka! (20)

PDF
What to learn during the 21 days Lockdown | Edureka
Edureka!
 
PDF
Top 10 Dying Programming Languages in 2020 | Edureka
Edureka!
 
PDF
Top 5 Trending Business Intelligence Tools | Edureka
Edureka!
 
PDF
Tableau Tutorial for Data Science | Edureka
Edureka!
 
PDF
Python Programming Tutorial | Edureka
Edureka!
 
PDF
Top 5 PMP Certifications | Edureka
Edureka!
 
PDF
Top Maven Interview Questions in 2020 | Edureka
Edureka!
 
PDF
Linux Mint Tutorial | Edureka
Edureka!
 
PDF
How to Deploy Java Web App in AWS| Edureka
Edureka!
 
PDF
Importance of Digital Marketing | Edureka
Edureka!
 
PDF
RPA in 2020 | Edureka
Edureka!
 
PDF
Email Notifications in Jenkins | Edureka
Edureka!
 
PDF
EA Algorithm in Machine Learning | Edureka
Edureka!
 
PDF
Cognitive AI Tutorial | Edureka
Edureka!
 
PDF
AWS Cloud Practitioner Tutorial | Edureka
Edureka!
 
PDF
Blue Prism Top Interview Questions | Edureka
Edureka!
 
PDF
Big Data on AWS Tutorial | Edureka
Edureka!
 
PDF
A star algorithm | A* Algorithm in Artificial Intelligence | Edureka
Edureka!
 
PDF
Kubernetes Installation on Ubuntu | Edureka
Edureka!
 
PDF
Introduction to DevOps | Edureka
Edureka!
 
What to learn during the 21 days Lockdown | Edureka
Edureka!
 
Top 10 Dying Programming Languages in 2020 | Edureka
Edureka!
 
Top 5 Trending Business Intelligence Tools | Edureka
Edureka!
 
Tableau Tutorial for Data Science | Edureka
Edureka!
 
Python Programming Tutorial | Edureka
Edureka!
 
Top 5 PMP Certifications | Edureka
Edureka!
 
Top Maven Interview Questions in 2020 | Edureka
Edureka!
 
Linux Mint Tutorial | Edureka
Edureka!
 
How to Deploy Java Web App in AWS| Edureka
Edureka!
 
Importance of Digital Marketing | Edureka
Edureka!
 
RPA in 2020 | Edureka
Edureka!
 
Email Notifications in Jenkins | Edureka
Edureka!
 
EA Algorithm in Machine Learning | Edureka
Edureka!
 
Cognitive AI Tutorial | Edureka
Edureka!
 
AWS Cloud Practitioner Tutorial | Edureka
Edureka!
 
Blue Prism Top Interview Questions | Edureka
Edureka!
 
Big Data on AWS Tutorial | Edureka
Edureka!
 
A star algorithm | A* Algorithm in Artificial Intelligence | Edureka
Edureka!
 
Kubernetes Installation on Ubuntu | Edureka
Edureka!
 
Introduction to DevOps | Edureka
Edureka!
 
Ad

Recently uploaded (20)

PDF
BLW VOCATIONAL TRAINING SUMMER INTERNSHIP REPORT
codernjn73
 
PDF
How Onsite IT Support Drives Business Efficiency, Security, and Growth.pdf
Captain IT
 
PDF
Oracle AI Vector Search- Getting Started and what's new in 2025- AIOUG Yatra ...
Sandesh Rao
 
PDF
Security features in Dell, HP, and Lenovo PC systems: A research-based compar...
Principled Technologies
 
PPTX
How to Build a Scalable Micro-Investing Platform in 2025 - A Founder’s Guide ...
Third Rock Techkno
 
PDF
Chapter 2 Digital Image Fundamentals.pdf
Getnet Tigabie Askale -(GM)
 
PPTX
The Power of IoT Sensor Integration in Smart Infrastructure and Automation.pptx
Rejig Digital
 
PDF
AI Unleashed - Shaping the Future -Starting Today - AIOUG Yatra 2025 - For Co...
Sandesh Rao
 
PDF
A Day in the Life of Location Data - Turning Where into How.pdf
Precisely
 
PDF
Make GenAI investments go further with the Dell AI Factory - Infographic
Principled Technologies
 
PPTX
Comunidade Salesforce São Paulo - Desmistificando o Omnistudio (Vlocity)
Francisco Vieira Júnior
 
PDF
Software Development Methodologies in 2025
KodekX
 
PDF
REPORT: Heating appliances market in Poland 2024
SPIUG
 
PDF
Cloud-Migration-Best-Practices-A-Practical-Guide-to-AWS-Azure-and-Google-Clou...
Artjoker Software Development Company
 
PDF
madgavkar20181017ppt McKinsey Presentation.pdf
georgschmitzdoerner
 
PPTX
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
AVTRON Technologies LLC
 
PDF
Unlocking the Future- AI Agents Meet Oracle Database 23ai - AIOUG Yatra 2025.pdf
Sandesh Rao
 
PDF
SparkLabs Primer on Artificial Intelligence 2025
SparkLabs Group
 
PDF
CIFDAQ's Token Spotlight: SKY - A Forgotten Giant's Comeback?
CIFDAQ
 
PDF
Using Anchore and DefectDojo to Stand Up Your DevSecOps Function
Anchore
 
BLW VOCATIONAL TRAINING SUMMER INTERNSHIP REPORT
codernjn73
 
How Onsite IT Support Drives Business Efficiency, Security, and Growth.pdf
Captain IT
 
Oracle AI Vector Search- Getting Started and what's new in 2025- AIOUG Yatra ...
Sandesh Rao
 
Security features in Dell, HP, and Lenovo PC systems: A research-based compar...
Principled Technologies
 
How to Build a Scalable Micro-Investing Platform in 2025 - A Founder’s Guide ...
Third Rock Techkno
 
Chapter 2 Digital Image Fundamentals.pdf
Getnet Tigabie Askale -(GM)
 
The Power of IoT Sensor Integration in Smart Infrastructure and Automation.pptx
Rejig Digital
 
AI Unleashed - Shaping the Future -Starting Today - AIOUG Yatra 2025 - For Co...
Sandesh Rao
 
A Day in the Life of Location Data - Turning Where into How.pdf
Precisely
 
Make GenAI investments go further with the Dell AI Factory - Infographic
Principled Technologies
 
Comunidade Salesforce São Paulo - Desmistificando o Omnistudio (Vlocity)
Francisco Vieira Júnior
 
Software Development Methodologies in 2025
KodekX
 
REPORT: Heating appliances market in Poland 2024
SPIUG
 
Cloud-Migration-Best-Practices-A-Practical-Guide-to-AWS-Azure-and-Google-Clou...
Artjoker Software Development Company
 
madgavkar20181017ppt McKinsey Presentation.pdf
georgschmitzdoerner
 
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
AVTRON Technologies LLC
 
Unlocking the Future- AI Agents Meet Oracle Database 23ai - AIOUG Yatra 2025.pdf
Sandesh Rao
 
SparkLabs Primer on Artificial Intelligence 2025
SparkLabs Group
 
CIFDAQ's Token Spotlight: SKY - A Forgotten Giant's Comeback?
CIFDAQ
 
Using Anchore and DefectDojo to Stand Up Your DevSecOps Function
Anchore
 

What is JavaScript Regex | Regular Expressions in JavaScript | Edureka

  • 1. Copyright © 2017, edureka and/or its affiliates. All rights reserved.
  • 4. A Regular Expression is a sequence of characters that constructs a search pattern. When you search for data in a text, you can use this search pattern to describe what you are looking for. What are Regular Expressions? www.edureka.co
  • 6. g It performs a global match i It performs case-insensitive matching m It performs multiline matching www.edureka.co
  • 8. [abc] Finds any character between the brackets [^abc] Finds any character NOT between the brackets [0-9] Finds any digit between the brackets [^0-9] Finds any non-digit NOT between the brackets www.edureka.co
  • 10. w It looks for a word character W It finds a non-word character d It finds a digit D It finds a non-digit Character s It finds a whitespace character S It finds a non-whitespace character b It finds a match at the beginning/end of a word B It looks for a match, but not at the beginning/end of a word f It finds a form feed character r It finds a carriage return character v It finds a vertical tab character t It finds a tab character www.edureka.co
  • 12. n+ It matches any string that contains at least one n n* It matches any string that contains zero or more occurrences of n n? It matches any string that contains zero or one occurrence of n n{X} It matches any string that contains a sequence of X n’s n{X,Y} It matches any string that contains a sequence of X to Y n’s n{X,} It matches any string that contains a sequence of at least X n’s n$ It matches any string with n at the end of it www.edureka.co
  • 14. Constructor Returns the function that creates the RegExp object’s prototype global Checks whether the “g” modifier is set ignoreCase Checks whether the “i” modifier is set lastIndex Specifies the index at which to start the next match multiline Checks whether the “m” modifier is set www.edureka.co
  • 16. Compile() It compiles a regular expression exec() It tests for a match in a string and returns the first match test() It tests for a match in a string and returns true or false toString() It returns the string value of the regular expression www.edureka.co
  • 17. Copyright © 2017, edureka and/or its affiliates. All rights reserved. www.edureka.co