مختبر التعابير النمطية
اختبر تعابير JavaScript في عامل معزول بمهلة تنفيذ.
المدخلات
تلميح: اضغط Ctrl + Enter للتشغيل
الإعدادات المحفوظة
المساعدة المفصلة أدناه متاحة بالإنجليزية فقط حاليًا.
حول هذه الأداة
Regular expressions are powerful and easy to get subtly wrong. This tester runs a JavaScript regular expression with the flags you choose against your sample text and lists the matches, their positions and capture groups. It runs in an isolated browser worker with a time limit, so a pattern with catastrophic backtracking stops instead of freezing the page.
The syntax is JavaScript’s, which differs in places from Python, PCRE or .NET (for example in lookbehind support in older browsers and named group syntax).
طريقة الاستخدام
- Enter the pattern without surrounding slashes, e.g. [A-Z]+.
- Enter flags such as g (all matches), i (ignore case), m (multiline) or u (Unicode).
- Paste sample text that includes cases that should and should not match.
- Run the test and refine the pattern until the matches are exactly right.
كيف يعمل الحساب
The pattern and flags are compiled with the JavaScript RegExp constructor inside a Web Worker. Matches are collected with their indexes and groups; the worker is terminated if it runs longer than the time limit.
مثال تطبيقي
The pattern [A-Z]+ with flag g against "HELLO world" finds one match, "HELLO", at position 0. Adding the i flag makes it match "world" as well, because case is ignored.
القيود
- JavaScript regular expression syntax only.
- Execution stops after the time limit.
- Sample text up to 100,000 characters.
آخر تحديث:
الأسئلة الشائعة
Should I include the slashes?
No. Enter only the pattern; flags go in their own box.
Why does my Python regex not work?
Some syntax differs. Named groups, for example, are (?<name>…) in JavaScript, not (?P<name>…).
What causes the timeout?
Nested quantifiers such as (a+)+ can take exponential time on some inputs. Simplify the pattern.
استكشاف الأخطاء وإصلاحها
It reports an invalid pattern.
Check for unescaped special characters such as ( ) [ ] { } . * + ? and unbalanced brackets.
Only the first match is shown.
Add the g flag to find all matches.
^ and $ do not match each line.
Add the m flag to make them match at line breaks.
الخصوصية & مجاني
هل تُخزَّن مدخلاتي؟
تبقى مدخلاتك في علامة التبويب هذه. لا نتلقى ملفاتك أو النصوص الملصقة أو قيم الحسابات.
هل هذه الأداة مجانية؟
نعم. لا يلزم تسجيل أو دفع.
انظر أيضًا
خطوات تالية مفيدة
منسّق JSON ومدقّقه
تحقّق من JSON أو نسّقه أو صغّره محليًا. لا تُرسل البيانات غير الصالحة إلى أي خادم.
المطورون وتحسين محركات البحثمحوّل CSV إلى JSON
حوّل ترويسات وسجلات CSV إلى JSON مع دعم الفواصل بين علامات الاقتباس وفواصل الأسطر.
المطورون وتحسين محركات البحثمحوّل JSON إلى CSV
حوّل مصفوفة مسطّحة من الكائنات إلى CSV. تُضاف بادئة حماية إلى النصوص الشبيهة بالمعادلات عند الاستيراد إلى جداول البيانات.
المطورون وتحسين محركات البحث