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.
Related Articles
View all articlesClaude Code's Security-Guidance Plugin: Shift-Left Security That Fixes Code as You Write It
Anthropic's free security-guidance plugin makes Claude Code review and fix vulnerabilities in the same session. Here's what it catches, how to install it, and how to roll org-wide rules across your team.
Read article →Claude Code: MCP, Subagents, Skills & Hooks — When to Use Which
MCP, subagents, skills, and hooks all extend Claude Code, but they solve different problems. Here's a practical decision guide for picking the right mechanism — and combining them.
Read article →Grok vs Regex: What's the Difference and When to Use Each
Grok vs regex isn't a fight. Grok IS regex with a reusable naming layer for log parsing. Here is when to reach for each and how to convert between them.
Read article →How to Fix _grokparsefailure: Debugging Grok Patterns Step by Step
_grokparsefailure tells you a grok pattern failed but not why. Here are the 7 most common causes and a step-by-step method to pinpoint and fix each one.
Read article →Explore More Development
View all termsAPI (Application Programming Interface)
A set of rules and protocols that allows different software applications to communicate and exchange data.
Read more →Cron Expression
A time-based job scheduling syntax using five or six fields to specify when tasks should run.
Read more →DevOps
A set of practices combining software development (Dev) and IT operations (Ops) to shorten development cycles and deliver high-quality software continuously.
Read more →Diff Algorithm
A computational method for comparing two sets of data and identifying differences between them.
Read more →GitOps
An operational framework that uses Git repositories as the single source of truth for declarative infrastructure and application configurations.
Read more →JSON (JavaScript Object Notation)
A lightweight data interchange format using human-readable text to represent structured data.
Read more →