مختبِر Regex
Test regular expressions with real-time match highlighting.
كيفية استخدام مختبِر Regex
Enter a regex pattern
Type your regular expression pattern in the input field between the forward slashes.
Set flags and test text
Toggle the desired flags and enter or paste the text you want to test against.
View matches
See highlighted matches in real time and check the match details table for groups and indices.
What is the Regex Tester?
A regular expression (regex) is a pattern used to search, match, and extract parts of text. This tester lets you write a regex, run it against sample text, and see every match highlighted in real time, so you can build and debug a pattern without guessing.
Type your pattern and choose flags like global, case-insensitive, and multiline. As you edit, the matches update live, which makes it easy to refine a pattern until it captures exactly what you want and nothing you do not.
- Test regex patterns against your own text live
- Highlights every match as you type
- Toggle common flags: global, ignore case, multiline
- Shows captured groups for each match
- Catches and reports invalid pattern syntax
- Runs in your browser with no data sent anywhere
Regex building blocks
Character classes like \d (digit), \w (word character), and \s (whitespace) match types of characters. Quantifiers like * (zero or more), + (one or more), and {2,4} (a range) control repetition. Anchors ^ and $ tie a match to the start or end of a line, and parentheses create capture groups you can pull out of each match.
What the flags do
The global flag finds every match rather than stopping at the first. Ignore case makes the pattern match regardless of upper or lower case. Multiline changes ^ and $ so they match at the start and end of each line instead of the whole string. Combining them is common, for example global plus ignore case to find all occurrences of a word in any casing.
Common patterns to start from
An email-like match is roughly [\w.+-]+@[\w-]+\.[\w.-]+. A number is \d+, and a number with optional decimals is \d+(\.\d+)?. To match a word boundary, use \b, which is handy when you want whole words only. Start from a simple pattern and tighten it as you watch the highlights update.
الأسئلة الشائعة
What regex flavor does this use?
How do I see captured groups?
What do the flags mean?
Will it tell me if my pattern is invalid?
Is my test text private?
أدوات ذات صلة
منسّق JSON
نسّق بيانات JSON وتحقّق من صحتها وأعد ترتيبها بمسافات بادئة واضحة.
محلّل تعابير Cron
Parse cron expressions into plain English and preview the next scheduled run times.
مدقّق CSS
Validate CSS syntax and find common errors like unmatched braces and missing semicolons.
مدقّق YAML
Validate YAML syntax and check for errors instantly.
مختبِر JSONPath
Test and validate JSON Path expressions against JSON data.
مدقّق بطاقات الائتمان (Luhn)
Validate credit card numbers using the Luhn algorithm.