Regex
83 cards · 🇺🇸 English
Regular expression syntax: metacharacters, quantifiers, groups, and anchors.
Study all 83 cards for free
Flashcards, quizzes, pixel-art games and a daily review that remembers for you.
Try the first 10 cards
1 / 10Regular expression (regex)
Tap the card for the answer · swipe right if you knew it, left if not
Already have an account? Sign in
Cards
- 1Regular expression (regex)A sequence of characters that defines a search pattern for text
- 2What does '.' (dot) match?Any single character except newline
- 3What does '^' match?The beginning of a line or string
- 4'*' quantifierMatches 0 or more occurrences of the preceding element
- 5{n} quantifierMatches exactly n occurrences of the preceding element
- 6{n,m} quantifierMatches between n and m occurrences of the preceding element
- 7'|' (pipe)Acts as an OR operator: matches either the pattern before or after
- 8What does '\d' match?Any digit (0-9)
- 9What does '\w' match?Any word character (alphanumeric + underscore)
- 10What does '\s' match?Any whitespace character (space, tab, newline)
- 11What does '\b' match?A word boundary (position between word and non-word character)
- 12Square brackets [ ]Define a character class: matches any one character inside the brackets
- 13What does [a-z] match?Any lowercase letter from a to z
- 14What does [0-9] match?Any digit from 0 to 9
- 15What does [^abc] match?Any character except a, b, or c (negation)
- 16Parentheses ( )Create a capturing group for extracting matched substrings
- 17'\' (backslash)Escapes special characters to match them literally
- 18Match a literal dotUse \. to escape the dot metacharacter
- 19Greedy quantifierMatches as much as possible (default behavior: *, +, {n,m})
- 20Lazy/non-greedy quantifierMatches as little as possible: use ? after quantifier (*?, +?, {n,m}?)
- 21What does \n match?A newline character
- 22What does \t match?A tab character
- 23What does \r match?A carriage return character
- 24Lookahead assertionMatches a pattern only if followed by another pattern: (?=...)
- 25Negative lookaheadMatches a pattern only if NOT followed by another pattern: (?!...)
- 26Lookbehind assertionMatches a pattern only if preceded by another pattern: (?<=...)
- 27Negative lookbehindMatches a pattern only if NOT preceded by another pattern: (?<!...)
- 28How to match an email pattern?Common pattern: [a-zA-Z0-9._%-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}
- 29How to match a URL pattern?Simple pattern: https?://[^\s]+
- 30How to match a phone number?Example: \d{3}-\d{3}-\d{4} for format like 123-456-7890
And 53 more cards. Study the whole deck free
Articles about this deck
More Programming decks
See all- 🧱
Data Structures
95 cards · 🇺🇸 English
Arrays, linked lists, trees, graphs, hash tables and their core operations.
- 🧱
Estructuras de Datos
95 cards · 🇺🇸 English
Arrays, listas enlazadas, árboles, grafos, tablas hash y sus operaciones fundamentales.
- 🏗️
Design Patterns & OOP/SOLID Principles
60 cards · 🇺🇸 English
The Gang of Four design patterns plus object-oriented and SOLID principles.
- ⏱️
Notación Big O
44 cards · 🇺🇸 English
Análisis de la complejidad temporal y espacial de algoritmos y operaciones comunes.
- ✅
Testing: Unit & Integration
40 cards · 🇺🇸 English
Unit testing, integration testing, mocking, and testing best practices.
- 🧱
Datenstrukturen
95 cards · 🇺🇸 English
Arrays, verkettete Listen, Bäume, Graphen, Hash-Tabellen und ihre wichtigsten Operationen.
