BBuildQuill
أدوات المطوّرين

مختبِر Regex

Test regular expressions with real-time match highlighting.

//gi

كيفية استخدام مختبِر Regex

1

Enter a regex pattern

Type your regular expression pattern in the input field between the forward slashes.

2

Set flags and test text

Toggle the desired flags and enter or paste the text you want to test against.

3

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?
It uses JavaScript regular expressions, the same engine that runs in browsers and Node.js, so patterns you test here behave the same in your web projects.
How do I see captured groups?
When your pattern contains parentheses, the tool shows the captured groups for each match, which is useful for extracting specific parts of the text.
What do the flags mean?
Global matches all occurrences, ignore case matches regardless of letter casing, and multiline makes the line anchors ^ and $ apply per line rather than to the entire input.
Will it tell me if my pattern is invalid?
Yes. If the regex has a syntax error, the tool reports it instead of failing silently, so you can fix the pattern quickly.
Is my test text private?
Yes. Matching happens in your browser, so neither your pattern nor your text is sent to a server.

أدوات ذات صلة