Monu Tools

مختبِر التعابير النمطية (Regex)

اختبر تعبيراً نمطياً (regex) على نصك في الوقت الفعلي. شاهد كل تطابق مظللاً، مع مجموعات الالتقاط والأعلام (flags). يعمل بالكامل داخل متصفحك.

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

  1. 01

    اكتب تعبيرك النمطي (regex) في حقل النمط.

  2. 02

    بدّل الأعلام (g، i، m، s، u) التي تحتاجها.

  3. 03

    أدخل نص الاختبار وشاهد التطابقات مظللة مع مجموعاتها.

What the regex tester does

The regex tester lets you build and debug regular expressions against your own sample text, with matches highlighted live as you type. It is useful for validating input formats, extracting fields from logs, or testing a pattern before pasting it into code.

Everything runs in your browser, so your patterns and test text are never uploaded.

Which engine it uses

It uses the JavaScript regular-expression engine, the same one in every browser and in Node.js, so a pattern that works here works in your JavaScript and TypeScript code.

Flags and capture groups

Toggle the global, case-insensitive, multiline and other flags to change how a pattern matches. You see every match along with its capture groups, so you can confirm exactly what each part of the pattern is pulling out.

Differences across regex flavors

Other languages such as PCRE, Python and Go share most syntax but differ in some features, so a few advanced constructs may behave differently outside JavaScript. If a pattern works here but not in another language, an engine-specific construct is usually the reason.

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

أي نكهة من regex تُستخدم؟

محرك JavaScript (ECMAScript) المدمج في متصفحك، فتطابق النتائج ما ستفعله شيفرة JavaScript وTypeScript لديك.

ماذا تعني الأعلام (flags)؟

العلم g يطابق كل المواضع، وi يتجاهل حالة الأحرف، وm يجعل ^ و$ يطابقان عند فواصل الأسطر، وs يجعل النقطة تطابق فواصل الأسطر، وu يفعّل المعالجة الكاملة لـ Unicode.

كيف أطابق عبر أسطر متعددة؟

فعّل علم تعدد الأسطر (m) ليطابق ^ و$ عند كل فاصل سطر، وأضف علم النقطة الشاملة (s) إذا احتجت أيضاً إلى أن تطابق النقطة رموز فواصل الأسطر.

هل تُعرض مجموعات الالتقاط؟

نعم. يسرد كل تطابق مجموعات الالتقاط المرقّمة الخاصة به، وتظهر المجموعات المسماة باسمها، فترى بالضبط ما التقطه كل جزء من النمط.

لماذا يعمل نمطي هنا ولا يعمل في لغة أخرى؟

يستخدم هذا محرك JavaScript. تشترك PCRE وPython وغيرها في معظم البنية لكنها تختلف في النظر إلى الخلف (lookbehind) والمجموعات المسماة وبعض الهروب، لذا انقل الأنماط المتقدمة بحذر.

هل يُرفع نصي؟

لا. يُقيَّم النمط ونص الاختبار بالكامل داخل متصفحك، ولا يغادران جهازك أبداً.

المصادر

ضمّن هذه الأداة

أضف هذه الأداة إلى موقعك الخاص. انسخ المقتطف أدناه، ويبقى محدّثاً تلقائياً.

<iframe src="https://monu.tools/embed/ar/regex-tester" width="100%" height="640" style="border:1px solid #e5e5e5;border-radius:12px;max-width:680px" loading="lazy" title="Monu Tools"></iframe>

أدوات ذات صلة