أداة اختبار وتصحيح التعابير العادية عبر الإنترنت مجانًا
تعمل مع التعابير العادية؟ تساعدك هذه الأداة من NerdLevelTech على اختبار وتصحيح التعابير العادية على الفور. فقط أدخل النمط الخاص بك، وأضف العلامات، والصق النص التجريبي للرؤية:
نمط وإعدادات التعبير العادي
Current flags: /g
النتائج
No matches found
Try adjusting your regex pattern or test text to find matches.
Understanding Regular Expressions
Regular expressions are essential tools for developers working with text processing, data validation, and pattern matching across all programming languages. Whether you're building form validation in JavaScript, parsing log files in Python, processing user input in PHP, or extracting data in Java, regex provides a concise syntax for complex text matching operations.
A regex pattern combines literal text with special metacharacters to define matching rules. For example, the pattern \d{3}-\d{2}-\d{4} matches US Social Security numbers by specifying exactly three digits, a hyphen, two digits, another hyphen, and four digits. The \d metacharacter represents any digit (0-9), while {3} specifies exactly three repetitions. Common regex patterns include email validation with [a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}, URL matching, phone number formats, and credit card validation.
Developers use regex for input sanitization, data extraction from unstructured text, find-and-replace operations in code editors, log file parsing, and web scraping. Understanding quantifiers like * (zero or more), + (one or more), and ? (zero or one) enables flexible pattern matching. Anchors such as ^ (start of string) and $ (end of string) ensure patterns match at specific positions.
Character classes like [A-Za-z] match letter ranges, while negated classes [^0-9] match anything except digits. Our regex tester provides real-time feedback on pattern matching, highlighting matches directly in your test text, displaying capture groups for data extraction, and showing JSON output for programmatic use. Test your patterns with different flags to see how global, case-insensitive, and multiline modes affect matching behavior before implementing them in production code.
الأسئلة الشائعة
ما هو مختبر التعبير العادي؟
مختبر التعبير العادي هو أداة تسمح لك باختبار أنماط التعبير العادي مقابل نص نموذجي. يُظهر لك الأجزاء من النص التي تتطابق مع النمط.
كيف أتحقق من عمل التعبير العادي الخاص بي؟
فقط المصق نمط التعبير العادي في حقل النمط، وضع العلامات، وأدخل النص التجريبي. ستقوم الأداة بتمييز التطابقات في الوقت الفعلي.
ما هي علامات التعبير العادي؟
تعدّل علامات التعبير العادي كيفية تطابق النمط. على سبيل المثال، 'g' يجد جميع التطابقات (عامة)، 'i' يتجاهل حالة الأحرف، 'm' يفعّل الوضع متعدد الأسطر.
هل يمكنني مشاركة اختبارات التعبير العادي؟
نعم! انقر على زر "مشاركة الاختبار" لإنشاء رابط يحتوي على نمط التعبير العادي الخاص بك والعلامات والنص التجريبي.
How do capture groups and backreferences work?
Parentheses () create numbered capture groups that store matched text for later use. In (\d{3})-(\d{2})-(\d{4}), three groups capture phone number parts. Backreferences like \1, \2 refer to captured groups within the same pattern. (\w+)\s+\1 matches repeated words. Named groups (?<name>pattern) provide clearer references than numbers.
What are lookaheads and lookbehinds in regex?
Lookaheads and lookbehinds are zero-width assertions that check for patterns without consuming characters. Positive lookahead (?=pattern) asserts pattern exists ahead. \d(?=px) matches digits followed by "px". Negative lookahead (?!pattern) asserts pattern does not exist. Positive lookbehind (?<=pattern) checks pattern behind. Negative lookbehind (?<!pattern) asserts pattern is not behind current position.
How do regex flags modify pattern matching behavior?
Flags change how the regex engine processes patterns. Global flag (g) finds all matches instead of stopping at first match. Case-insensitive flag (i) ignores letter case. Multiline flag (m) makes ^ and $ match line boundaries within text. Dotall flag (s) makes dot (.) match newline characters. Unicode flag (u) enables full Unicode support. Sticky flag (y) matches only from lastIndex position.
What are common use cases for regular expressions?
Regular expressions excel at: validating input formats (email addresses, phone numbers, URLs, credit cards); extracting data from text (parsing logs, scraping HTML); find-and-replace operations with pattern-based substitution; tokenizing and parsing structured data; cleaning and normalizing text; validating password strength; syntax highlighting in code editors; and search functionality with advanced pattern matching beyond simple string search.
يتم إجراء جميع اختبارات التعبير العادي في متصفحك. لا يتم إرسال أي بيانات إلى خوادمنا أو تخزينها في أي مكان.