What Are Regular Expressions?
Regular expressions (regex) are patterns used to match character combinations in strings. They are a powerful tool for searching, validating, and transforming text.
Common Flags
- g — Global: find all matches, not just the first.
- i — Case-insensitive: match regardless of case.
- m — Multiline: ^ and $ match start/end of each line.
- s — Dotall: . matches newline characters.
Quick Reference
.— Any character (except newline)\d— Any digit (0-9)\w— Word character (a-z, A-Z, 0-9, _)\s— Whitespace character*— Zero or more times+— One or more times?— Zero or one time[abc]— Character class(group)— Capture group
Frequently Asked Questions
Is this tool using JavaScript regex?
Yes. This tool uses JavaScript's built-in RegExp engine. Syntax may differ slightly from other languages like Python or PCRE.