SlideShare une entreprise Scribd logo
1  sur  17
Télécharger pour lire hors ligne
Regular Expressions
Part 1: Basic Building Blocks
What is a regular
expression?
Simple, an expression used regularly!
/ah/
Yes that is a regular expression!
You don’t believe me, try http://rubular.com/r/31xqIzPmPe
/aah/
Wonder how you’ll match
/aaaaaaaa...h/
Repetition Token
Token Property Regex Example Test String
{m, n} Match exact
occurrences of a
character/token
a{1,3}h ah, aah, aaah, aaaah,
h, ha, aha
? Matches 0 or 1
occurrence of a
token
a?h ah, aah, aaah, aaaah,
h, ha, aha
+ Matches 1 or more
occurrence of a
token
a+h ah, aah, aaah, aaaah,
h, ha, aha
* Matches 0 or more
occurrence of a
token
a*h ah, aah, aaah, aaaah,
h, ha, aha
Repetition Token
Token Property Regex Example Test String
{m, n} Match exact
occurrences of a
character/token
a{1,3}h ah, aah, aaah, aaaah,
h, ha, haaha
? Matches 0 or 1
occurrence of a
token
a?h ah, aah, aaah, aaaah,
h, ha, haaha
+ Matches 1 or more
occurrence of a
token
a+h ah, aah, aaah, aaaah,
h, ha, haaha
* Matches 0 or more
occurrence of a
token
a*h ah, aah, aaah, aaaah,
h, ha, haaha
Challenge 1:
Highlight the
first match for
string in
orange
Anchor Token
Token Property Regex Example Test String
^ Matches the
position at the start
of Line
^ah ah, aah, ha, aha,
ha<newline>ah
$ Matches the
position at the end
of Line
ah$ ah, aah, ha, aha,
ah<newline>ha
A Matches the
position at the start
of String
Aah ah, aah, ha, aha,
ha<newline>ah
Z Matches the
position at the end
of String
ahZ ah, aah, ha, aha,
ah<newline>ha
Character Token
Token Property Regex Example Test String
[a-zA-Z0-9] Matches one out of
several characters
gr[ea]y grey, gray, greay
[^a-zA-Z0-9] Matches any
character which is
not one of those in
the character set.
q[^u] qatar, Iraq,
[a-zA-Z0-9]+ Matches repeating
characters
[0-9]+ 333, 222, 123
[1st - [2nd]] Matches any one
character in first list
but not in the
second list.
[0-9-[02468]]+ 1357, 124, 111
Shortcut Character Token
Token Property Regex Example Test String
d Matches any digit d{1,9} 1, 123456789,
1234235259
s Matches any
whitespace
character
s+$ t, blank line with
spaces.
w Matches any word
character i.e.
letters, numbers, _
w{1,5} foo_1, $foo_1
D, S, W Matches opposite of
the above character
classes.
D+ Foobar, hello
world123!
Challenge 2:
Match 10 digit
mobile number
entered by user on
your signup form.
Ultimate Character - The .
The dot matches one of any character except the line break.
Challenge 2
^d{10,10}$
^$: Are anchor tags to
anchor to start and end of
input, prevents matching
abc0000000000
{10, 10}: matches
specifically 10 numbers
Solutions
Challenge 1
/a{1,3}h/ haaha
/a?h/ haaha
/a+h/ haaha
/a*h/ haaha
Let’s not get greedy.
We’ll dive deeper later!
Questions?

Contenu connexe

Tendances

Regex Presentation
Regex PresentationRegex Presentation
Regex Presentationarnolambert
 
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 ExpressionsDanny Bryant
 
Basics of Object Oriented Programming in Python
Basics of Object Oriented Programming in PythonBasics of Object Oriented Programming in Python
Basics of Object Oriented Programming in PythonSujith Kumar
 
Top 65 SQL Interview Questions and Answers | Edureka
Top 65 SQL Interview Questions and Answers | EdurekaTop 65 SQL Interview Questions and Answers | Edureka
Top 65 SQL Interview Questions and Answers | EdurekaEdureka!
 
Introduction to SQL
Introduction to SQLIntroduction to SQL
Introduction to SQLEhsan Hamzei
 
Regular expression
Regular expressionRegular expression
Regular expressionLarry Nung
 
Aggregate functions
Aggregate functionsAggregate functions
Aggregate functionssinhacp
 
Python Programming Tutorial | Edureka
Python Programming Tutorial | EdurekaPython Programming Tutorial | Edureka
Python Programming Tutorial | EdurekaEdureka!
 
Clean Code: Chapter 3 Function
Clean Code: Chapter 3 FunctionClean Code: Chapter 3 Function
Clean Code: Chapter 3 FunctionKent Huang
 
Covering (Rules-based) Algorithm
Covering (Rules-based) AlgorithmCovering (Rules-based) Algorithm
Covering (Rules-based) AlgorithmZHAO Sam
 
Function arguments In Python
Function arguments In PythonFunction arguments In Python
Function arguments In PythonAmit Upadhyay
 
Php Tutorial
Php TutorialPhp Tutorial
Php TutorialSridhar P
 

Tendances (20)

Adv. python regular expression by Rj
Adv. python regular expression by RjAdv. python regular expression by Rj
Adv. python regular expression by Rj
 
Regex Presentation
Regex PresentationRegex Presentation
Regex Presentation
 
MySQL JOIN & UNION
MySQL JOIN & UNIONMySQL JOIN & UNION
MySQL JOIN & UNION
 
Ruby on Rails Presentation
Ruby on Rails PresentationRuby on Rails Presentation
Ruby on Rails Presentation
 
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
 
Basics of Object Oriented Programming in Python
Basics of Object Oriented Programming in PythonBasics of Object Oriented Programming in Python
Basics of Object Oriented Programming in Python
 
Top 65 SQL Interview Questions and Answers | Edureka
Top 65 SQL Interview Questions and Answers | EdurekaTop 65 SQL Interview Questions and Answers | Edureka
Top 65 SQL Interview Questions and Answers | Edureka
 
MySQL lecture
MySQL lectureMySQL lecture
MySQL lecture
 
joins in database
 joins in database joins in database
joins in database
 
Threads in python
Threads in pythonThreads in python
Threads in python
 
Introduction to SQL
Introduction to SQLIntroduction to SQL
Introduction to SQL
 
Regular expression
Regular expressionRegular expression
Regular expression
 
Clean code
Clean codeClean code
Clean code
 
Aggregate functions
Aggregate functionsAggregate functions
Aggregate functions
 
Python Programming Tutorial | Edureka
Python Programming Tutorial | EdurekaPython Programming Tutorial | Edureka
Python Programming Tutorial | Edureka
 
Clean Code: Chapter 3 Function
Clean Code: Chapter 3 FunctionClean Code: Chapter 3 Function
Clean Code: Chapter 3 Function
 
Covering (Rules-based) Algorithm
Covering (Rules-based) AlgorithmCovering (Rules-based) Algorithm
Covering (Rules-based) Algorithm
 
Function arguments In Python
Function arguments In PythonFunction arguments In Python
Function arguments In Python
 
Php Tutorial
Php TutorialPhp Tutorial
Php Tutorial
 
07. Virtual Functions
07. Virtual Functions07. Virtual Functions
07. Virtual Functions
 

Similaire à Introducing Regular Expressions

An Introduction to Regular expressions
An Introduction to Regular expressionsAn Introduction to Regular expressions
An Introduction to Regular expressionsYamagata Europe
 
Regular expressions in oracle
Regular expressions in oracleRegular expressions in oracle
Regular expressions in oracleLogan Palanisamy
 
Looking for Patterns
Looking for PatternsLooking for Patterns
Looking for PatternsKeith Wright
 
Regular expressions
Regular expressionsRegular expressions
Regular expressionsRaj Gupta
 
Regular Expressions 2007
Regular Expressions 2007Regular Expressions 2007
Regular Expressions 2007Geoffrey Dunn
 
Php String And Regular Expressions
Php String  And Regular ExpressionsPhp String  And Regular Expressions
Php String And Regular Expressionsmussawir20
 
Regular Expressions in PHP, MySQL by programmerblog.net
Regular Expressions in PHP, MySQL by programmerblog.netRegular Expressions in PHP, MySQL by programmerblog.net
Regular Expressions in PHP, MySQL by programmerblog.netProgrammer Blog
 
16 Java Regex
16 Java Regex16 Java Regex
16 Java Regexwayn
 
Regex startup
Regex startupRegex startup
Regex startupPayPal
 
Python (regular expression)
Python (regular expression)Python (regular expression)
Python (regular expression)Chirag Shetty
 
Basta mastering regex power
Basta mastering regex powerBasta mastering regex power
Basta mastering regex powerMax Kleiner
 
Regular Expression Cheat Sheet
Regular Expression Cheat SheetRegular Expression Cheat Sheet
Regular Expression Cheat SheetSydneyJohnson57
 

Similaire à Introducing Regular Expressions (20)

Regex Basics
Regex BasicsRegex Basics
Regex Basics
 
Regular Expressions
Regular ExpressionsRegular Expressions
Regular Expressions
 
2013 - Andrei Zmievski: Clínica Regex
2013 - Andrei Zmievski: Clínica Regex2013 - Andrei Zmievski: Clínica Regex
2013 - Andrei Zmievski: Clínica Regex
 
An Introduction to Regular expressions
An Introduction to Regular expressionsAn Introduction to Regular expressions
An Introduction to Regular expressions
 
Regex lecture
Regex lectureRegex lecture
Regex lecture
 
Regular expressions in oracle
Regular expressions in oracleRegular expressions in oracle
Regular expressions in oracle
 
Looking for Patterns
Looking for PatternsLooking for Patterns
Looking for Patterns
 
Regular expressions
Regular expressionsRegular expressions
Regular expressions
 
Regular Expressions 2007
Regular Expressions 2007Regular Expressions 2007
Regular Expressions 2007
 
Php String And Regular Expressions
Php String  And Regular ExpressionsPhp String  And Regular Expressions
Php String And Regular Expressions
 
Regular Expressions in PHP, MySQL by programmerblog.net
Regular Expressions in PHP, MySQL by programmerblog.netRegular Expressions in PHP, MySQL by programmerblog.net
Regular Expressions in PHP, MySQL by programmerblog.net
 
Patterns
PatternsPatterns
Patterns
 
16 Java Regex
16 Java Regex16 Java Regex
16 Java Regex
 
Regex startup
Regex startupRegex startup
Regex startup
 
Python (regular expression)
Python (regular expression)Python (regular expression)
Python (regular expression)
 
Basta mastering regex power
Basta mastering regex powerBasta mastering regex power
Basta mastering regex power
 
Regex Intro
Regex IntroRegex Intro
Regex Intro
 
Regular Expression Cheat Sheet
Regular Expression Cheat SheetRegular Expression Cheat Sheet
Regular Expression Cheat Sheet
 
Ruby RegEx
Ruby RegExRuby RegEx
Ruby RegEx
 
RegEx Book.pdf
RegEx Book.pdfRegEx Book.pdf
RegEx Book.pdf
 

Plus de Neha Jain

Bringing HTML5 uploads to SlideShare
Bringing HTML5 uploads to SlideShareBringing HTML5 uploads to SlideShare
Bringing HTML5 uploads to SlideShareNeha Jain
 
The power of happiness
The power of happinessThe power of happiness
The power of happinessNeha Jain
 
Houserentreceipt
HouserentreceiptHouserentreceipt
HouserentreceiptNeha Jain
 
Slideshareistestinginfographics regularupload
Slideshareistestinginfographics regularuploadSlideshareistestinginfographics regularupload
Slideshareistestinginfographics regularuploadNeha Jain
 
House rent receipt
House rent receiptHouse rent receipt
House rent receiptNeha Jain
 
Byte of vim_v051
Byte of vim_v051Byte of vim_v051
Byte of vim_v051Neha Jain
 

Plus de Neha Jain (7)

FindIn
FindInFindIn
FindIn
 
Bringing HTML5 uploads to SlideShare
Bringing HTML5 uploads to SlideShareBringing HTML5 uploads to SlideShare
Bringing HTML5 uploads to SlideShare
 
The power of happiness
The power of happinessThe power of happiness
The power of happiness
 
Houserentreceipt
HouserentreceiptHouserentreceipt
Houserentreceipt
 
Slideshareistestinginfographics regularupload
Slideshareistestinginfographics regularuploadSlideshareistestinginfographics regularupload
Slideshareistestinginfographics regularupload
 
House rent receipt
House rent receiptHouse rent receipt
House rent receipt
 
Byte of vim_v051
Byte of vim_v051Byte of vim_v051
Byte of vim_v051
 

Dernier

Why does (not) Kafka need fsync: Eliminating tail latency spikes caused by fsync
Why does (not) Kafka need fsync: Eliminating tail latency spikes caused by fsyncWhy does (not) Kafka need fsync: Eliminating tail latency spikes caused by fsync
Why does (not) Kafka need fsync: Eliminating tail latency spikes caused by fsyncssuser2ae721
 
Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.eptoze12
 
Churning of Butter, Factors affecting .
Churning of Butter, Factors affecting  .Churning of Butter, Factors affecting  .
Churning of Butter, Factors affecting .Satyam Kumar
 
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdf
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdfCCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdf
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdfAsst.prof M.Gokilavani
 
Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024hassan khalil
 
computer application and construction management
computer application and construction managementcomputer application and construction management
computer application and construction managementMariconPadriquez1
 
Artificial-Intelligence-in-Electronics (K).pptx
Artificial-Intelligence-in-Electronics (K).pptxArtificial-Intelligence-in-Electronics (K).pptx
Artificial-Intelligence-in-Electronics (K).pptxbritheesh05
 
Risk Assessment For Installation of Drainage Pipes.pdf
Risk Assessment For Installation of Drainage Pipes.pdfRisk Assessment For Installation of Drainage Pipes.pdf
Risk Assessment For Installation of Drainage Pipes.pdfROCENODodongVILLACER
 
Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...VICTOR MAESTRE RAMIREZ
 
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdfCCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdfAsst.prof M.Gokilavani
 
Call Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile serviceCall Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile servicerehmti665
 
TechTAC® CFD Report Summary: A Comparison of Two Types of Tubing Anchor Catchers
TechTAC® CFD Report Summary: A Comparison of Two Types of Tubing Anchor CatchersTechTAC® CFD Report Summary: A Comparison of Two Types of Tubing Anchor Catchers
TechTAC® CFD Report Summary: A Comparison of Two Types of Tubing Anchor Catcherssdickerson1
 
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)Dr SOUNDIRARAJ N
 
Work Experience-Dalton Park.pptxfvvvvvvv
Work Experience-Dalton Park.pptxfvvvvvvvWork Experience-Dalton Park.pptxfvvvvvvv
Work Experience-Dalton Park.pptxfvvvvvvvLewisJB
 

Dernier (20)

Why does (not) Kafka need fsync: Eliminating tail latency spikes caused by fsync
Why does (not) Kafka need fsync: Eliminating tail latency spikes caused by fsyncWhy does (not) Kafka need fsync: Eliminating tail latency spikes caused by fsync
Why does (not) Kafka need fsync: Eliminating tail latency spikes caused by fsync
 
Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.
 
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCRCall Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
 
Churning of Butter, Factors affecting .
Churning of Butter, Factors affecting  .Churning of Butter, Factors affecting  .
Churning of Butter, Factors affecting .
 
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdf
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdfCCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdf
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdf
 
🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...
🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...
🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...
 
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
 
Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024
 
computer application and construction management
computer application and construction managementcomputer application and construction management
computer application and construction management
 
Artificial-Intelligence-in-Electronics (K).pptx
Artificial-Intelligence-in-Electronics (K).pptxArtificial-Intelligence-in-Electronics (K).pptx
Artificial-Intelligence-in-Electronics (K).pptx
 
Risk Assessment For Installation of Drainage Pipes.pdf
Risk Assessment For Installation of Drainage Pipes.pdfRisk Assessment For Installation of Drainage Pipes.pdf
Risk Assessment For Installation of Drainage Pipes.pdf
 
Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...
 
POWER SYSTEMS-1 Complete notes examples
POWER SYSTEMS-1 Complete notes  examplesPOWER SYSTEMS-1 Complete notes  examples
POWER SYSTEMS-1 Complete notes examples
 
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdfCCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
 
Call Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile serviceCall Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile service
 
Design and analysis of solar grass cutter.pdf
Design and analysis of solar grass cutter.pdfDesign and analysis of solar grass cutter.pdf
Design and analysis of solar grass cutter.pdf
 
young call girls in Green Park🔝 9953056974 🔝 escort Service
young call girls in Green Park🔝 9953056974 🔝 escort Serviceyoung call girls in Green Park🔝 9953056974 🔝 escort Service
young call girls in Green Park🔝 9953056974 🔝 escort Service
 
TechTAC® CFD Report Summary: A Comparison of Two Types of Tubing Anchor Catchers
TechTAC® CFD Report Summary: A Comparison of Two Types of Tubing Anchor CatchersTechTAC® CFD Report Summary: A Comparison of Two Types of Tubing Anchor Catchers
TechTAC® CFD Report Summary: A Comparison of Two Types of Tubing Anchor Catchers
 
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)
 
Work Experience-Dalton Park.pptxfvvvvvvv
Work Experience-Dalton Park.pptxfvvvvvvvWork Experience-Dalton Park.pptxfvvvvvvv
Work Experience-Dalton Park.pptxfvvvvvvv
 

Introducing Regular Expressions

  • 1. Regular Expressions Part 1: Basic Building Blocks
  • 2. What is a regular expression?
  • 3. Simple, an expression used regularly!
  • 4.
  • 5. /ah/ Yes that is a regular expression!
  • 6. You don’t believe me, try http://rubular.com/r/31xqIzPmPe /aah/
  • 7. Wonder how you’ll match /aaaaaaaa...h/
  • 8. Repetition Token Token Property Regex Example Test String {m, n} Match exact occurrences of a character/token a{1,3}h ah, aah, aaah, aaaah, h, ha, aha ? Matches 0 or 1 occurrence of a token a?h ah, aah, aaah, aaaah, h, ha, aha + Matches 1 or more occurrence of a token a+h ah, aah, aaah, aaaah, h, ha, aha * Matches 0 or more occurrence of a token a*h ah, aah, aaah, aaaah, h, ha, aha
  • 9. Repetition Token Token Property Regex Example Test String {m, n} Match exact occurrences of a character/token a{1,3}h ah, aah, aaah, aaaah, h, ha, haaha ? Matches 0 or 1 occurrence of a token a?h ah, aah, aaah, aaaah, h, ha, haaha + Matches 1 or more occurrence of a token a+h ah, aah, aaah, aaaah, h, ha, haaha * Matches 0 or more occurrence of a token a*h ah, aah, aaah, aaaah, h, ha, haaha Challenge 1: Highlight the first match for string in orange
  • 10. Anchor Token Token Property Regex Example Test String ^ Matches the position at the start of Line ^ah ah, aah, ha, aha, ha<newline>ah $ Matches the position at the end of Line ah$ ah, aah, ha, aha, ah<newline>ha A Matches the position at the start of String Aah ah, aah, ha, aha, ha<newline>ah Z Matches the position at the end of String ahZ ah, aah, ha, aha, ah<newline>ha
  • 11. Character Token Token Property Regex Example Test String [a-zA-Z0-9] Matches one out of several characters gr[ea]y grey, gray, greay [^a-zA-Z0-9] Matches any character which is not one of those in the character set. q[^u] qatar, Iraq, [a-zA-Z0-9]+ Matches repeating characters [0-9]+ 333, 222, 123 [1st - [2nd]] Matches any one character in first list but not in the second list. [0-9-[02468]]+ 1357, 124, 111
  • 12. Shortcut Character Token Token Property Regex Example Test String d Matches any digit d{1,9} 1, 123456789, 1234235259 s Matches any whitespace character s+$ t, blank line with spaces. w Matches any word character i.e. letters, numbers, _ w{1,5} foo_1, $foo_1 D, S, W Matches opposite of the above character classes. D+ Foobar, hello world123!
  • 13. Challenge 2: Match 10 digit mobile number entered by user on your signup form.
  • 14. Ultimate Character - The . The dot matches one of any character except the line break.
  • 15. Challenge 2 ^d{10,10}$ ^$: Are anchor tags to anchor to start and end of input, prevents matching abc0000000000 {10, 10}: matches specifically 10 numbers Solutions Challenge 1 /a{1,3}h/ haaha /a?h/ haaha /a+h/ haaha /a*h/ haaha
  • 16. Let’s not get greedy. We’ll dive deeper later!