تخطى إلى المحتوى الرئيسي

اختبار التعبيرات المنتظمة

Regular expressions are one of the most powerful — and most confusing — tools in a developer's arsenal. Our regex tester gives you a real-time match highlighter, named capture group extractor, explanation of each part of your pattern in plain English, and a reference cheat sheet. Supports JavaScript (default), PCRE, and Python regex flavors.

/ /

التطابقات

لم يُعثَر على تطابقات

شارك هذه الأداة
Developer Tools

حول Regex Tester

Regular expressions are one of the most powerful — and most confusing — tools in a developer's arsenal. Our regex tester gives you a real-time match highlighter, named capture group extractor, explanation of each part of your pattern in plain English, and a reference cheat sheet. Supports JavaScript (default), PCRE, and Python regex flavors.

كيفية الاستخدام

  1. Enter your regex pattern in the pattern field.
  2. Set flags: g (global), i (case-insensitive), m (multiline), s (dotAll).
  3. Paste test text — all matches highlight live.
  4. View named capture groups, full match, and groups in a structured table.
  5. Click "Explain" to get a plain-English breakdown of each regex token.

الصيغة والمنهجية

Common tokens: . (any char), \d (digit), \w (word char), \s (whitespace), ^ (line start), $ (line end), * (0+), + (1+), ? (0 or 1), {n,m} (n to m). Groups: () capture, (?:) non-capture, (?<name>) named. Lookahead: (?=), (?!). Lookbehind: (?<=), (?<!). Alternation: |.

حالات الاستخدام الشائعة

  • Form validation: email, phone number, ZIP code patterns
  • Log parsing: extracting timestamps, error codes, IP addresses
  • Find-and-replace in code editors: refactoring variable names
  • URL routing: matching path patterns in web frameworks
  • Data cleaning: removing or normalizing inconsistent text formats

الأسئلة الشائعة

Greedy quantifiers (*, +, {n,m}) match as much as possible. Lazy/reluctant quantifiers (*?, +?, {n,m}?) match as little as possible. Example: on "<b>bold</b>text<b>more</b>", the pattern <b>.*</b> (greedy) matches the entire string from first <b> to last </b>. <b>.*?</b> (lazy) matches just "<b>bold</b>" then "<b>more</b>" separately. Lazy is usually what you want for HTML-like parsing.
HTML is not a regular language — it has recursive nesting that finite automata (which regex implements) cannot fully handle. Regex can match simple patterns in HTML reliably, but fails on edge cases: nested tags, attributes with quotes, self-closing tags, and malformed HTML. For robust HTML processing, use a proper DOM parser (DOMParser in JS, BeautifulSoup in Python, DOMDocument in PHP).

أدوات ذات صلة

كل الأدوات →

دمج هذه الأداة في موقعك

مجاني للاستخدام الشخصي والتجاري. فقط انسخ الكود أدناه.