DevelopmentAlso called: "regex", "regexp", "pattern matching"
Regular expressions define search patterns using special characters and quantifiers.
Common patterns
- ^ and $: Match start and end of string.
- . : Any character except newline.
- \d, \w, \s: Digits, word characters, whitespace.
- +, *, ?: One or more, zero or more, zero or one.
- [abc], [^abc]: Character sets and negation.
Use cases
- Validate email addresses, phone numbers, URLs.
- Extract data from logs and text files.
- Find and replace patterns in code.
- Input sanitization and data parsing.
Security warnings
- Catastrophic backtracking (ReDoS) can cause denial of service.
- Always test regex performance with adversarial inputs.
Explore More Development
View all termsCron Expression
A time-based job scheduling syntax using five or six fields to specify when tasks should run.
Read more →Diff Algorithm
A computational method for comparing two sets of data and identifying differences between them.
Read more →JSON (JavaScript Object Notation)
A lightweight data interchange format using human-readable text to represent structured data.
Read more →Markdown
A lightweight markup language that uses plain text formatting to create structured documents.
Read more →Text Diff (Difference)
A comparison showing line-by-line or character-by-character changes between two versions of text.
Read more →Universally Unique Identifier (UUID)
A 128-bit identifier guaranteed to be unique across space and time without central coordination.
Read more →