SlideShare a Scribd company logo
1 of 10
Download to read offline
Syd Johnson 2018
Regular Expression Cheat Sheet
This cheat sheet exists to support you throughout your journey
conquering Regular Expression. Use it to discover, organize, and
implement your ideas. Read it. Learn it. Visit it often.
Expression Function Example

Common Tokens
This common token has many
different uses. If a special
character (!, @, #, $, %, etc.)
is already a part of the text
string you want to match,
insert this token before the
problem character, and your
string will still take effect.
( )
This common token will match
whatever character(s) enclosed
inside of it.
Syd Johnson 2018
[ ]
Trap your characters in square
brackets to convey a range of
numbers or letters.
Your square brackets don’t
have to contain ranges; try a
few specific characters for a
more tailored approach. This
function works with any
characters in any order.
Include both uppercase and
lowercase ranges in your
brackets to exclude case
sensitivity.
Insert a ^ before your
range/characters in your square
brackets to exclude whatever
follows it.
. This common token will find
absolutely any character,
whether numerical or
alphabetical.
Syd Johnson 2018
.
This common token followed
with the quantifier * serves as
an ultimate catch all. The two
tokens together will find any
characters with any or all
repetitions.
|
This is an alternation
expression. It provides the
ability to communicate that
you want options in your
matches. It essentially
translates to “OR.”
Make sure to use parentheses
instead of square brackets to
house this token.
**Identical expressions and unidentical phone
numbers.
The token . is inserted to identify the
parentheses.**
^
Anchors
This anchor signifies the start
of a line. It’s inserted at the
beginning of a string.
This anchor holds a different
function inside and outside of
brackets.
$
This anchor signifies the end of
a line. It’s inserted at the end
of a string.
Syd Johnson 2018
$
An exact sentence match can
be made when the anchors ^
and $ are used in the same
string.
A This anchor serves to match at
the starting point of the
character string. This anchor is
inserted at the beginning of the
regex.
A not included:
A included:
**In the Regex above, [0-9]+ signifies a string
of digits with one or more repetitions**
Z This anchor serves to match at
the ending point of the
character string. This anchor is
inserted at the end of the regex.
B not included:
B included:
**In the Regex above, [0-9]+ signifies a string
of digits with one or more repetitions**
Syd Johnson 2018
b
This anchor serves to separate
groups of letters and/or digits.
This anchor does not consume
any characters and does not
consider any non-
numerical/non-alphabetical
characters.
B
This anchor serves to separate
each numerical or alphabetical
character when not connected
to a non-alphabetical/non-
numerical character.
{ }
Quantifiers
Insert a number in curvy
brackets at the end of a string
to signify how many
repetitions you’re
looking for.
Insert a comma between two
numbers in curvy brackets to
signify a range of desired
repetitions.
If you’d like to represent
infinity, insert a comma after
your minimum desired
repetitions.
Syd Johnson 2018
?
Insert this quantifier at the end
of a string to signify up to one
repetition. It’s essentially
making the string optional.
+
Insert this quantifier at the end
of a string to signify one to an
infinite amount of repetitions
({1,}).
*
Insert this quantifier at the end
of a string to signify zero to an
infinite amount of repetitions.
This is a catch all; it could
either inform you that the
desired string doesn’t exist or
that it exists many times.
Syd Johnson 2018
s
Meta Sequences
This meta sequence will match
any whitespace character in the
string.
S This meta sequence will match
any character other than a
whitespace.
d This meta sequences will
match any digit.
D This meta sequence will match
any non-digit.
Syd Johnson 2018
w
This meta sequence will match
any alphabetical or numerical
character.
When the quantifier + (one to
infinite repetitions) is inserted
following this token, it will
match whole words.
W
This meta sequence will match
any character other than a letter
or number.
v
This meta sequence serves to
recognize the number of
newlines. It won’t consume
any characters.
K
This meta sequence will
modify the regular expression
to begin to match characters at
a certain point.
**The [0-9]+ in this expression signifies one or
more repetitions of numerical characters, the
[A-Za-z]+ signifies one or more repetitions of
non-case sensitive alphabetical characters,
and the s serves to match whitespace.**
Syd Johnson 2018
Q E
When special characters are
enclosed in between these two
meta sequences, those
character are then treated as
literals.
CHALLENGER
Once you understand the functions above, see if you can build a
Regular Expression that will match your home address. Be sure
to use https://www.regex101.com to check your answer.
TIP
The meta sequence /s matches non-character spaces (the white
space!), and the quantifier + signifies one or more repetitions.
ANSWER
With some flexibility, your Regular Expression could look
something like this:
[0-9]+s[A-Za-z]+s[A-Za-z]+
Syd Johnson 2018
(?<regex)
Group Constructs
This group construct is called a
positive lookahead. It assists in
identifying characters that are
preceded with other known
characters.
This construct is inserted at the
beginning of a string.
To identify a set of letters preceded by
a set of numbers:
**The quantifier + in this Regex is
signifying one to an infinite number
of repetitions**
(?=regex)
This group construct is called a
negative lookbehind. It assists in
identifying characters that are
followed by other known
characters.
This construct is inserted at the
end of a string.
To identify a set of letters followed by a
set of numbers:
**The quantifier + in this Regex is
signifying one to an infinite number
of repetitions**
[[:<:]]
Character Classes
This character class will match
the first character of your choice
wherever it begins a word/group
of characters. The desired
letter/number must be inserted
at the end of the expression.
[[:>:]]
This character class will match
the first character of your choice
whenever it ends a word/group
of characters. The desired
letter/number must be inserted
at the beginning of the
expression

More Related Content

What's hot

Neo4J : Introduction to Graph Database
Neo4J : Introduction to Graph DatabaseNeo4J : Introduction to Graph Database
Neo4J : Introduction to Graph DatabaseMindfire Solutions
 
Real time entity resolution with elasticsearch - haystack 2018
Real time entity resolution with elasticsearch - haystack 2018Real time entity resolution with elasticsearch - haystack 2018
Real time entity resolution with elasticsearch - haystack 2018OpenSource Connections
 
Pycon2017 이성용 Dances with the Last Samurai
Pycon2017 이성용 Dances with the Last SamuraiPycon2017 이성용 Dances with the Last Samurai
Pycon2017 이성용 Dances with the Last SamuraiSungYong Lee
 
Tokenization using nlp | NLP Course
Tokenization using nlp | NLP CourseTokenization using nlp | NLP Course
Tokenization using nlp | NLP CourseRAKESH P
 
Seven Peaks Speaks - Compose Navigation
Seven Peaks Speaks - Compose NavigationSeven Peaks Speaks - Compose Navigation
Seven Peaks Speaks - Compose NavigationSeven Peaks Speaks
 
Word2vec algorithm
Word2vec algorithmWord2vec algorithm
Word2vec algorithmAndrew Koo
 
Data Migration Done Right for Microsoft Dynamics 365/CRM
Data Migration Done Right for Microsoft Dynamics 365/CRMData Migration Done Right for Microsoft Dynamics 365/CRM
Data Migration Done Right for Microsoft Dynamics 365/CRMDaniel Cai
 
14 programando em python - interfaces graficas com tk
 14   programando em python - interfaces graficas com tk 14   programando em python - interfaces graficas com tk
14 programando em python - interfaces graficas com tkVictor Marcelino
 
KorQuAD introduction
KorQuAD introductionKorQuAD introduction
KorQuAD introductionSeungyoungLim
 
미등록단어 문제 해결을 위한 비지도학습 기반 한국어자연어처리 방법론 및 응용
미등록단어 문제 해결을 위한 비지도학습 기반 한국어자연어처리 방법론 및 응용미등록단어 문제 해결을 위한 비지도학습 기반 한국어자연어처리 방법론 및 응용
미등록단어 문제 해결을 위한 비지도학습 기반 한국어자연어처리 방법론 및 응용NAVER Engineering
 
맵매칭 (부정확한 GPS포인트들로부터 경로 추정하기)
맵매칭 (부정확한 GPS포인트들로부터 경로 추정하기)맵매칭 (부정확한 GPS포인트들로부터 경로 추정하기)
맵매칭 (부정확한 GPS포인트들로부터 경로 추정하기)if kakao
 
Best Practices with Apex in 2022.pdf
Best Practices with Apex in 2022.pdfBest Practices with Apex in 2022.pdf
Best Practices with Apex in 2022.pdfMohith Shrivastava
 
LPW: Beginners Perl
LPW: Beginners PerlLPW: Beginners Perl
LPW: Beginners PerlDave Cross
 
Knowledge Graphs and Generative AI
Knowledge Graphs and Generative AIKnowledge Graphs and Generative AI
Knowledge Graphs and Generative AINeo4j
 
기계독해를 위한 BERT 언어처리 모델 활용
기계독해를 위한 BERT 언어처리 모델 활용기계독해를 위한 BERT 언어처리 모델 활용
기계독해를 위한 BERT 언어처리 모델 활용Kenneth Jung
 
Conversational AI with Transformer Models
Conversational AI with Transformer ModelsConversational AI with Transformer Models
Conversational AI with Transformer ModelsDatabricks
 
Important Salesforce Trends to Watch Out for in 2022
Important Salesforce Trends to Watch Out for in 2022Important Salesforce Trends to Watch Out for in 2022
Important Salesforce Trends to Watch Out for in 2022Cloud Analogy
 

What's hot (20)

Neo4J : Introduction to Graph Database
Neo4J : Introduction to Graph DatabaseNeo4J : Introduction to Graph Database
Neo4J : Introduction to Graph Database
 
Real time entity resolution with elasticsearch - haystack 2018
Real time entity resolution with elasticsearch - haystack 2018Real time entity resolution with elasticsearch - haystack 2018
Real time entity resolution with elasticsearch - haystack 2018
 
Pycon2017 이성용 Dances with the Last Samurai
Pycon2017 이성용 Dances with the Last SamuraiPycon2017 이성용 Dances with the Last Samurai
Pycon2017 이성용 Dances with the Last Samurai
 
Tokenization using nlp | NLP Course
Tokenization using nlp | NLP CourseTokenization using nlp | NLP Course
Tokenization using nlp | NLP Course
 
Seven Peaks Speaks - Compose Navigation
Seven Peaks Speaks - Compose NavigationSeven Peaks Speaks - Compose Navigation
Seven Peaks Speaks - Compose Navigation
 
Word2vec algorithm
Word2vec algorithmWord2vec algorithm
Word2vec algorithm
 
Data Migration Done Right for Microsoft Dynamics 365/CRM
Data Migration Done Right for Microsoft Dynamics 365/CRMData Migration Done Right for Microsoft Dynamics 365/CRM
Data Migration Done Right for Microsoft Dynamics 365/CRM
 
14 programando em python - interfaces graficas com tk
 14   programando em python - interfaces graficas com tk 14   programando em python - interfaces graficas com tk
14 programando em python - interfaces graficas com tk
 
KorQuAD introduction
KorQuAD introductionKorQuAD introduction
KorQuAD introduction
 
미등록단어 문제 해결을 위한 비지도학습 기반 한국어자연어처리 방법론 및 응용
미등록단어 문제 해결을 위한 비지도학습 기반 한국어자연어처리 방법론 및 응용미등록단어 문제 해결을 위한 비지도학습 기반 한국어자연어처리 방법론 및 응용
미등록단어 문제 해결을 위한 비지도학습 기반 한국어자연어처리 방법론 및 응용
 
맵매칭 (부정확한 GPS포인트들로부터 경로 추정하기)
맵매칭 (부정확한 GPS포인트들로부터 경로 추정하기)맵매칭 (부정확한 GPS포인트들로부터 경로 추정하기)
맵매칭 (부정확한 GPS포인트들로부터 경로 추정하기)
 
Best Practices with Apex in 2022.pdf
Best Practices with Apex in 2022.pdfBest Practices with Apex in 2022.pdf
Best Practices with Apex in 2022.pdf
 
LPW: Beginners Perl
LPW: Beginners PerlLPW: Beginners Perl
LPW: Beginners Perl
 
R learning by examples
R learning by examplesR learning by examples
R learning by examples
 
R Language Introduction
R Language IntroductionR Language Introduction
R Language Introduction
 
Data model in salesforce
Data model in salesforceData model in salesforce
Data model in salesforce
 
Knowledge Graphs and Generative AI
Knowledge Graphs and Generative AIKnowledge Graphs and Generative AI
Knowledge Graphs and Generative AI
 
기계독해를 위한 BERT 언어처리 모델 활용
기계독해를 위한 BERT 언어처리 모델 활용기계독해를 위한 BERT 언어처리 모델 활용
기계독해를 위한 BERT 언어처리 모델 활용
 
Conversational AI with Transformer Models
Conversational AI with Transformer ModelsConversational AI with Transformer Models
Conversational AI with Transformer Models
 
Important Salesforce Trends to Watch Out for in 2022
Important Salesforce Trends to Watch Out for in 2022Important Salesforce Trends to Watch Out for in 2022
Important Salesforce Trends to Watch Out for in 2022
 

Similar to Regular Expression Cheat Sheet

Regular expressions
Regular expressionsRegular expressions
Regular expressionsRaghu nath
 
Regular_Expressions.pptx
Regular_Expressions.pptxRegular_Expressions.pptx
Regular_Expressions.pptxDurgaNayak4
 
Regular Expression in Action
Regular Expression in ActionRegular Expression in Action
Regular Expression in ActionFolio3 Software
 
FUNDAMENTALS OF REGULAR EXPRESSION (RegEX).pdf
FUNDAMENTALS OF REGULAR EXPRESSION (RegEX).pdfFUNDAMENTALS OF REGULAR EXPRESSION (RegEX).pdf
FUNDAMENTALS OF REGULAR EXPRESSION (RegEX).pdfBryan Alejos
 
Maxbox starter20
Maxbox starter20Maxbox starter20
Maxbox starter20Max Kleiner
 
Introduction_to_Regular_Expressions_in_R
Introduction_to_Regular_Expressions_in_RIntroduction_to_Regular_Expressions_in_R
Introduction_to_Regular_Expressions_in_RHellen Gakuruh
 
Regular Expression Crash Course
Regular Expression Crash CourseRegular Expression Crash Course
Regular Expression Crash CourseImran Qasim
 
Regular expressions
Regular expressionsRegular expressions
Regular expressionskeeyre
 
Looking for Patterns
Looking for PatternsLooking for Patterns
Looking for PatternsKeith Wright
 
Python - Regular Expressions
Python - Regular ExpressionsPython - Regular Expressions
Python - Regular ExpressionsMukesh Tekwani
 
Bioinformatica 06-10-2011-p2 introduction
Bioinformatica 06-10-2011-p2 introductionBioinformatica 06-10-2011-p2 introduction
Bioinformatica 06-10-2011-p2 introductionProf. Wim Van Criekinge
 
Basta mastering regex power
Basta mastering regex powerBasta mastering regex power
Basta mastering regex powerMax Kleiner
 
What is JavaScript Regex | Regular Expressions in JavaScript | Edureka
What is JavaScript Regex | Regular Expressions in JavaScript | EdurekaWhat is JavaScript Regex | Regular Expressions in JavaScript | Edureka
What is JavaScript Regex | Regular Expressions in JavaScript | EdurekaEdureka!
 
Chapter 3: Introduction to Regular Expression
Chapter 3: Introduction to Regular ExpressionChapter 3: Introduction to Regular Expression
Chapter 3: Introduction to Regular Expressionazzamhadeel89
 
Regular expressions
Regular expressionsRegular expressions
Regular expressionsRaj Gupta
 
Regular Expressions 2007
Regular Expressions 2007Regular Expressions 2007
Regular Expressions 2007Geoffrey Dunn
 

Similar to Regular Expression Cheat Sheet (20)

Adv. python regular expression by Rj
Adv. python regular expression by RjAdv. python regular expression by Rj
Adv. python regular expression by Rj
 
Regular expressions
Regular expressionsRegular expressions
Regular expressions
 
Regular_Expressions.pptx
Regular_Expressions.pptxRegular_Expressions.pptx
Regular_Expressions.pptx
 
Regular Expressions in Stata
Regular Expressions in StataRegular Expressions in Stata
Regular Expressions in Stata
 
2013 - Andrei Zmievski: Clínica Regex
2013 - Andrei Zmievski: Clínica Regex2013 - Andrei Zmievski: Clínica Regex
2013 - Andrei Zmievski: Clínica Regex
 
Regular Expression in Action
Regular Expression in ActionRegular Expression in Action
Regular Expression in Action
 
Regex lecture
Regex lectureRegex lecture
Regex lecture
 
FUNDAMENTALS OF REGULAR EXPRESSION (RegEX).pdf
FUNDAMENTALS OF REGULAR EXPRESSION (RegEX).pdfFUNDAMENTALS OF REGULAR EXPRESSION (RegEX).pdf
FUNDAMENTALS OF REGULAR EXPRESSION (RegEX).pdf
 
Maxbox starter20
Maxbox starter20Maxbox starter20
Maxbox starter20
 
Introduction_to_Regular_Expressions_in_R
Introduction_to_Regular_Expressions_in_RIntroduction_to_Regular_Expressions_in_R
Introduction_to_Regular_Expressions_in_R
 
Regular Expression Crash Course
Regular Expression Crash CourseRegular Expression Crash Course
Regular Expression Crash Course
 
Regular expressions
Regular expressionsRegular expressions
Regular expressions
 
Looking for Patterns
Looking for PatternsLooking for Patterns
Looking for Patterns
 
Python - Regular Expressions
Python - Regular ExpressionsPython - Regular Expressions
Python - Regular Expressions
 
Bioinformatica 06-10-2011-p2 introduction
Bioinformatica 06-10-2011-p2 introductionBioinformatica 06-10-2011-p2 introduction
Bioinformatica 06-10-2011-p2 introduction
 
Basta mastering regex power
Basta mastering regex powerBasta mastering regex power
Basta mastering regex power
 
What is JavaScript Regex | Regular Expressions in JavaScript | Edureka
What is JavaScript Regex | Regular Expressions in JavaScript | EdurekaWhat is JavaScript Regex | Regular Expressions in JavaScript | Edureka
What is JavaScript Regex | Regular Expressions in JavaScript | Edureka
 
Chapter 3: Introduction to Regular Expression
Chapter 3: Introduction to Regular ExpressionChapter 3: Introduction to Regular Expression
Chapter 3: Introduction to Regular Expression
 
Regular expressions
Regular expressionsRegular expressions
Regular expressions
 
Regular Expressions 2007
Regular Expressions 2007Regular Expressions 2007
Regular Expressions 2007
 

Recently uploaded

08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 

Recently uploaded (20)

08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 

Regular Expression Cheat Sheet

  • 1. Syd Johnson 2018 Regular Expression Cheat Sheet This cheat sheet exists to support you throughout your journey conquering Regular Expression. Use it to discover, organize, and implement your ideas. Read it. Learn it. Visit it often. Expression Function Example Common Tokens This common token has many different uses. If a special character (!, @, #, $, %, etc.) is already a part of the text string you want to match, insert this token before the problem character, and your string will still take effect. ( ) This common token will match whatever character(s) enclosed inside of it.
  • 2. Syd Johnson 2018 [ ] Trap your characters in square brackets to convey a range of numbers or letters. Your square brackets don’t have to contain ranges; try a few specific characters for a more tailored approach. This function works with any characters in any order. Include both uppercase and lowercase ranges in your brackets to exclude case sensitivity. Insert a ^ before your range/characters in your square brackets to exclude whatever follows it. . This common token will find absolutely any character, whether numerical or alphabetical.
  • 3. Syd Johnson 2018 . This common token followed with the quantifier * serves as an ultimate catch all. The two tokens together will find any characters with any or all repetitions. | This is an alternation expression. It provides the ability to communicate that you want options in your matches. It essentially translates to “OR.” Make sure to use parentheses instead of square brackets to house this token. **Identical expressions and unidentical phone numbers. The token . is inserted to identify the parentheses.** ^ Anchors This anchor signifies the start of a line. It’s inserted at the beginning of a string. This anchor holds a different function inside and outside of brackets. $ This anchor signifies the end of a line. It’s inserted at the end of a string.
  • 4. Syd Johnson 2018 $ An exact sentence match can be made when the anchors ^ and $ are used in the same string. A This anchor serves to match at the starting point of the character string. This anchor is inserted at the beginning of the regex. A not included: A included: **In the Regex above, [0-9]+ signifies a string of digits with one or more repetitions** Z This anchor serves to match at the ending point of the character string. This anchor is inserted at the end of the regex. B not included: B included: **In the Regex above, [0-9]+ signifies a string of digits with one or more repetitions**
  • 5. Syd Johnson 2018 b This anchor serves to separate groups of letters and/or digits. This anchor does not consume any characters and does not consider any non- numerical/non-alphabetical characters. B This anchor serves to separate each numerical or alphabetical character when not connected to a non-alphabetical/non- numerical character. { } Quantifiers Insert a number in curvy brackets at the end of a string to signify how many repetitions you’re looking for. Insert a comma between two numbers in curvy brackets to signify a range of desired repetitions. If you’d like to represent infinity, insert a comma after your minimum desired repetitions.
  • 6. Syd Johnson 2018 ? Insert this quantifier at the end of a string to signify up to one repetition. It’s essentially making the string optional. + Insert this quantifier at the end of a string to signify one to an infinite amount of repetitions ({1,}). * Insert this quantifier at the end of a string to signify zero to an infinite amount of repetitions. This is a catch all; it could either inform you that the desired string doesn’t exist or that it exists many times.
  • 7. Syd Johnson 2018 s Meta Sequences This meta sequence will match any whitespace character in the string. S This meta sequence will match any character other than a whitespace. d This meta sequences will match any digit. D This meta sequence will match any non-digit.
  • 8. Syd Johnson 2018 w This meta sequence will match any alphabetical or numerical character. When the quantifier + (one to infinite repetitions) is inserted following this token, it will match whole words. W This meta sequence will match any character other than a letter or number. v This meta sequence serves to recognize the number of newlines. It won’t consume any characters. K This meta sequence will modify the regular expression to begin to match characters at a certain point. **The [0-9]+ in this expression signifies one or more repetitions of numerical characters, the [A-Za-z]+ signifies one or more repetitions of non-case sensitive alphabetical characters, and the s serves to match whitespace.**
  • 9. Syd Johnson 2018 Q E When special characters are enclosed in between these two meta sequences, those character are then treated as literals. CHALLENGER Once you understand the functions above, see if you can build a Regular Expression that will match your home address. Be sure to use https://www.regex101.com to check your answer. TIP The meta sequence /s matches non-character spaces (the white space!), and the quantifier + signifies one or more repetitions. ANSWER With some flexibility, your Regular Expression could look something like this: [0-9]+s[A-Za-z]+s[A-Za-z]+
  • 10. Syd Johnson 2018 (?<regex) Group Constructs This group construct is called a positive lookahead. It assists in identifying characters that are preceded with other known characters. This construct is inserted at the beginning of a string. To identify a set of letters preceded by a set of numbers: **The quantifier + in this Regex is signifying one to an infinite number of repetitions** (?=regex) This group construct is called a negative lookbehind. It assists in identifying characters that are followed by other known characters. This construct is inserted at the end of a string. To identify a set of letters followed by a set of numbers: **The quantifier + in this Regex is signifying one to an infinite number of repetitions** [[:<:]] Character Classes This character class will match the first character of your choice wherever it begins a word/group of characters. The desired letter/number must be inserted at the end of the expression. [[:>:]] This character class will match the first character of your choice whenever it ends a word/group of characters. The desired letter/number must be inserted at the beginning of the expression