Skip to content

Online Regex tester

Test your regular expressions with instant result highlighting and detailed information

/ /
โœ“ Valid expression 0 matches
0 matches in 0 characters
Code Meaning
.Any character except a newline
*Zero or more
+One or more
?Zero or one
^Start of text
$End of text
\dDigit 0-9
\wLetter, digit, or _
\sWhitespace
\bWord boundary
[abc]Any character from the set
(abc)Capture group
a|ba or b
{n,m}n to m times
Common patterns โ€” click to apply

Email

[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Z]{2,}
flags: gi

Saudi phone number

(966|\+966|0)?5[0-9]{8}
flags: g

URL link

https?://(www.)?[-a-zA-Z0-9@%._+~#=]{2,256}.[a-z]{2,6}...
flags: gi

Arabic digits only

[\u0660-\u0669]+
flags: g

Arabic text only

[\u0600-\u06FF\s]+
flags: g

Strong password

^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[@$!%*?&])[A-Za-z\d@$!%*?&]{8,}$
flags: g

What is Regex, or a regular expression?

Regex is short for Regular Expression, a text pattern that describes a set of strings. Developers use it to search, validate, and extract text in all programming languages such as JavaScript, Python, PHP, and Java.

How do you use the Regex testing tool?

Enter your regular expression in the top field and type the test text in the bottom area, and the results appear instantly with matches highlighted in orange. You can try the ready-made patterns for email addresses, links, and numbers.

What are the common Regex flags?

g means search the whole text, i means ignore letter case, m means treat each line as a separate text, and s means the dot also matches a newline.

๐ŸŽ Free use: Start free, no sign-up. It runs inside your browser, so your files and data are not uploaded to any server.

About the Regex Tester

This tool tests regular expressions (Regex) on text you enter and highlights matches instantly, making them easier to learn and debug before putting them in code. It supports flags such as g, i, and m.

How do you use it?

  1. Type the pattern in the regular expression field.
  2. Choose the right flags (such as g for global search).
  3. Paste the text you want to test.
  4. Watch the highlighted matches and adjust the pattern until you get what you need.

Practical example

The pattern \d+ on the text "I have 12 books and 5 pens" matches 12 and 5.

When is it useful?

Regular expressions are a mini language for describing text patterns, found in almost every programming language with minor differences. The best way to learn them is hands-on experimentation and seeing matches live, as this tool lets you do.

Important tips

Frequently asked questions

What does the g flag mean?

It keeps searching to find all matches, not just the first one.

Does it support Arabic?

Yes, you can match Arabic letters using a Unicode range.

Why doesn't my pattern match?

Make sure special characters such as . and ( are escaped with a backslash.

๐Ÿ”’ The tool runs inside your browser, so your files and data are never uploaded to our server. Did you run into a problem or have a suggestion to improve the tool? Contact us.