SlideShare a Scribd company logo
1 of 1
Download to read offline
Anchors                                     Quantifiers                                 Groups and Ranges

^                Start of string            *                 0 or more                  .             Any character except
A               Start of string            +                 1 or more                                new line (n)
$                End of string              ?                 0 or 1                     (a|b)         a or b
Z               End of string              {3}               Exactly 3                  (...)         Group
b               Word boundary              {3,}              3 or more                  (?:...)       Passive Group
B               Not word boundary          {3,5}             3, 4 or 5                  [abc]         Range (a or b or c)
<               Start of word                                                           [^abc]        Not a or b or c
>               End of word                                                             [a-q]         Letter between a and q
                                            Quantifier Modifiers
                                                                                         [A-Q]         Upper case letter
                                            "x" below represents a quantifier                          between A and Q
Character Classes
                                            x?                                           [0-7]         Digit between 0 and 7
                                                              Ungreedy version of "x"
                                                                                         n          nth group/subpattern
c               Control character
                                                                                         Note: Ranges are inclusive.
s               White space                Escape Character
S               Not white space
d               Digit                                                                 Pattern Modifiers
                                                              Escape Character
D               Not digit
w                                                                                       g            Global match
                 Word
W                                          Metacharacters (must be escaped)             i            Case-insensitive
                 Not word
x                                                                                       m            Multiple lines
                 Hexadecimal digit
                                                   ^             [              .        s            Treat string as single line
O               Octal digit
                                                   $             {              *        x            Allow comments and
                                                   (                           +                     white space in pattern
POSIX
                                                   )             |              ?        e            Evaluate replacement
                                                   <             >                       U            Ungreedy pattern
[:upper:]        Upper case letters
[:lower:]        Lower case letters
[:alpha:]        All letters                Special Characters                          String Replacement (Backreferences)
[:alnum:]        Digits and letters
[:digit:]        Digits                     n                New line                   $n           nth non-passive group
[:xdigit:]       Hexadecimal digits         r                Carriage return            $2           "xyz" in /^(abc(xyz))$/
[:punct:]        Punctuation                t                Tab                        $1           "xyz" in /^(?:abc)(xyz)$/
[:blank:]        Space and tab              v                Vertical tab               $`           Before matched string
[:space:]        Blank characters           f                Form feed                  $'           After matched string
[:cntrl:]        Control characters         xxx              Octal character xxx        $+           Last matched string
[:graph:]        Printed characters         xhh              Hex character hh           $&           Entire matched string
[:print:]        Printed characters and
                 spaces                     Sample Patterns
[:word:]         Digits, letters and
                 underscore                 Pattern                                      Will Match
                                            ([A-Za-z0-9-]+)                              Letters, numbers and hyphens
                                            (d{1,2}/d{1,2}/d{4})                    Date (e.g. 21/3/2006)
Assertions
                                            ([^s]+(?=.(jpg|gif|png)).2)              jpg, gif or png image
?=               Lookahead assertion        (^[1-9]{1}$|^[1-4]{1}[0-9]{1}$|^50$)         Any number from 1 to 50 inclusive
?!               Negative lookahead         (#?([A-Fa-f0-9]){3}(([A-Fa-f0-9]){3})?)      Valid hexadecimal colour code
?<=              Lookbehind assertion       ((?=.*d)(?=.*[a-z])(?=.*[A-Z]).{8,15})      String with at least one upper case
?!= or ?<!       Negative lookbehind                                                     letter, one lower case letter, and one
?>               Once-only Subexpression                                                 digit (useful for passwords).
?()              Condition [if then]        (w+@[a-zA-Z_]+?.[a-zA-Z]{2,6})             Email addresses
?()|             Condition [if then else]   (<(/?[^>]+)>)                             HTML Tags
?#               Comment
                                            Note: These patterns are intended for reference purposes and have not been
                                            extensively tested. Please use with caution and test thoroughly before use.
             Available free from
          www.ILoveJackDaniels.com

More Related Content

Viewers also liked

Evaluacion trimestral
Evaluacion trimestralEvaluacion trimestral
Evaluacion trimestralraquel
 
Materi kuliah 09 sort part 4
Materi kuliah 09   sort part 4Materi kuliah 09   sort part 4
Materi kuliah 09 sort part 4Budi Yono
 
Ds u1 id_luhr
Ds u1 id_luhrDs u1 id_luhr
Ds u1 id_luhrpantro756
 
Herramientas de calculo
Herramientas de calculoHerramientas de calculo
Herramientas de calculocefaloga
 
10 guia redes 5 conceptos de redes 1 (1)
10 guia redes 5 conceptos de redes 1 (1)10 guia redes 5 conceptos de redes 1 (1)
10 guia redes 5 conceptos de redes 1 (1)Manuela Salazar Velilla
 
Ms 65 marketing of services
Ms 65  marketing of servicesMs 65  marketing of services
Ms 65 marketing of servicessmumbahelp
 
QRMailBox portachiavi facile da ritrovare.
QRMailBox portachiavi facile da ritrovare.QRMailBox portachiavi facile da ritrovare.
QRMailBox portachiavi facile da ritrovare.Carmelo Carchedi
 
Las mujeres en la química
Las mujeres en la química Las mujeres en la química
Las mujeres en la química Andres Martin
 
книга за 60 дней
книга за 60 днейкнига за 60 дней
книга за 60 днейmoksellegroup
 
Datavisualisatie voor journalisten persacademie
Datavisualisatie voor journalisten persacademieDatavisualisatie voor journalisten persacademie
Datavisualisatie voor journalisten persacademiemaartenzam
 

Viewers also liked (13)

Evaluacion trimestral
Evaluacion trimestralEvaluacion trimestral
Evaluacion trimestral
 
Materi kuliah 09 sort part 4
Materi kuliah 09   sort part 4Materi kuliah 09   sort part 4
Materi kuliah 09 sort part 4
 
Ds u1 id_luhr
Ds u1 id_luhrDs u1 id_luhr
Ds u1 id_luhr
 
Herramientas de calculo
Herramientas de calculoHerramientas de calculo
Herramientas de calculo
 
Ficha+para+mantenimiento
Ficha+para+mantenimientoFicha+para+mantenimiento
Ficha+para+mantenimiento
 
10 guia redes 5 conceptos de redes 1 (1)
10 guia redes 5 conceptos de redes 1 (1)10 guia redes 5 conceptos de redes 1 (1)
10 guia redes 5 conceptos de redes 1 (1)
 
Ms 65 marketing of services
Ms 65  marketing of servicesMs 65  marketing of services
Ms 65 marketing of services
 
Bail application
Bail applicationBail application
Bail application
 
QRMailBox portachiavi facile da ritrovare.
QRMailBox portachiavi facile da ritrovare.QRMailBox portachiavi facile da ritrovare.
QRMailBox portachiavi facile da ritrovare.
 
Jere douglas2
Jere douglas2Jere douglas2
Jere douglas2
 
Las mujeres en la química
Las mujeres en la química Las mujeres en la química
Las mujeres en la química
 
книга за 60 дней
книга за 60 днейкнига за 60 дней
книга за 60 дней
 
Datavisualisatie voor journalisten persacademie
Datavisualisatie voor journalisten persacademieDatavisualisatie voor journalisten persacademie
Datavisualisatie voor journalisten persacademie
 

Similar to Regexps (20)

Regex cheatsheet
Regex cheatsheetRegex cheatsheet
Regex cheatsheet
 
mhg
mhgmhg
mhg
 
test vedio
test vediotest vedio
test vedio
 
qwdeqwe
qwdeqweqwdeqwe
qwdeqwe
 
Added to test pdf
Added to test pdf Added to test pdf
Added to test pdf
 
added for test
added for test added for test
added for test
 
ganesh testing
ganesh testing ganesh testing
ganesh testing
 
now its pdf
now its pdfnow its pdf
now its pdf
 
fghfghf
fghfghffghfghf
fghfghf
 
The hindu
The hinduThe hindu
The hindu
 
Video added by Normal user
Video added by Normal user Video added by Normal user
Video added by Normal user
 
Resource one
Resource one Resource one
Resource one
 
Added to test pdf
Added to test pdf Added to test pdf
Added to test pdf
 
dasdasd
dasdasddasdasd
dasdasd
 
estset
estsetestset
estset
 
1377874234 eeeeeeeeeeeeeeeor more file
1377874234 eeeeeeeeeeeeeeeor more file1377874234 eeeeeeeeeeeeeeeor more file
1377874234 eeeeeeeeeeeeeeeor more file
 
Ganesh added
Ganesh added Ganesh added
Ganesh added
 
test
testtest
test
 
om
omom
om
 
test
testtest
test
 

Recently uploaded

Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
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
 
🐬 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
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 
[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
 
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
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
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
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
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
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 

Recently uploaded (20)

Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
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
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
[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
 
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
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
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
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
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
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 

Regexps

  • 1. Anchors Quantifiers Groups and Ranges ^ Start of string * 0 or more . Any character except A Start of string + 1 or more new line (n) $ End of string ? 0 or 1 (a|b) a or b Z End of string {3} Exactly 3 (...) Group b Word boundary {3,} 3 or more (?:...) Passive Group B Not word boundary {3,5} 3, 4 or 5 [abc] Range (a or b or c) < Start of word [^abc] Not a or b or c > End of word [a-q] Letter between a and q Quantifier Modifiers [A-Q] Upper case letter "x" below represents a quantifier between A and Q Character Classes x? [0-7] Digit between 0 and 7 Ungreedy version of "x" n nth group/subpattern c Control character Note: Ranges are inclusive. s White space Escape Character S Not white space d Digit Pattern Modifiers Escape Character D Not digit w g Global match Word W Metacharacters (must be escaped) i Case-insensitive Not word x m Multiple lines Hexadecimal digit ^ [ . s Treat string as single line O Octal digit $ { * x Allow comments and ( + white space in pattern POSIX ) | ? e Evaluate replacement < > U Ungreedy pattern [:upper:] Upper case letters [:lower:] Lower case letters [:alpha:] All letters Special Characters String Replacement (Backreferences) [:alnum:] Digits and letters [:digit:] Digits n New line $n nth non-passive group [:xdigit:] Hexadecimal digits r Carriage return $2 "xyz" in /^(abc(xyz))$/ [:punct:] Punctuation t Tab $1 "xyz" in /^(?:abc)(xyz)$/ [:blank:] Space and tab v Vertical tab $` Before matched string [:space:] Blank characters f Form feed $' After matched string [:cntrl:] Control characters xxx Octal character xxx $+ Last matched string [:graph:] Printed characters xhh Hex character hh $& Entire matched string [:print:] Printed characters and spaces Sample Patterns [:word:] Digits, letters and underscore Pattern Will Match ([A-Za-z0-9-]+) Letters, numbers and hyphens (d{1,2}/d{1,2}/d{4}) Date (e.g. 21/3/2006) Assertions ([^s]+(?=.(jpg|gif|png)).2) jpg, gif or png image ?= Lookahead assertion (^[1-9]{1}$|^[1-4]{1}[0-9]{1}$|^50$) Any number from 1 to 50 inclusive ?! Negative lookahead (#?([A-Fa-f0-9]){3}(([A-Fa-f0-9]){3})?) Valid hexadecimal colour code ?<= Lookbehind assertion ((?=.*d)(?=.*[a-z])(?=.*[A-Z]).{8,15}) String with at least one upper case ?!= or ?<! Negative lookbehind letter, one lower case letter, and one ?> Once-only Subexpression digit (useful for passwords). ?() Condition [if then] (w+@[a-zA-Z_]+?.[a-zA-Z]{2,6}) Email addresses ?()| Condition [if then else] (<(/?[^>]+)>) HTML Tags ?# Comment Note: These patterns are intended for reference purposes and have not been extensively tested. Please use with caution and test thoroughly before use. Available free from www.ILoveJackDaniels.com