aboutsummaryrefslogtreecommitdiff
path: root/files/ar/web/javascript/guide/regular_expressions/index.html
diff options
context:
space:
mode:
Diffstat (limited to 'files/ar/web/javascript/guide/regular_expressions/index.html')
-rw-r--r--files/ar/web/javascript/guide/regular_expressions/index.html813
1 files changed, 813 insertions, 0 deletions
diff --git a/files/ar/web/javascript/guide/regular_expressions/index.html b/files/ar/web/javascript/guide/regular_expressions/index.html
new file mode 100644
index 0000000000..96928196f8
--- /dev/null
+++ b/files/ar/web/javascript/guide/regular_expressions/index.html
@@ -0,0 +1,813 @@
+---
+title: التعبيرات القياسية
+slug: Web/JavaScript/Guide/Regular_Expressions
+translation_of: Web/JavaScript/Guide/Regular_Expressions
+---
+<div>{{jsSidebar("JavaScript Guide")}} {{PreviousNext("Web/JavaScript/Guide/Text_formatting", "Web/JavaScript/Guide/Indexed_collections")}}</div>
+
+<p class="summary" dir="rtl">التعبيرات القياسية (Regular Expressions)، هي أنماط (patterns) تُستخدم لمطابقة مجموعة من الأحرف في السلاسل النصية. التعبيرات القياسية في جافاسكربت كائنات أيضا. تُستخدم هذه الأنماط مع الوظائف {{jsxref("RegExp.exec", "exec")}} و{{jsxref("RegExp.test", "test")}} للكائن {{jsxref("RegExp")}}، ومع الوظائف {{jsxref("String.match", "match")}}، و {{jsxref("String.replace", "replace")}}، و{{jsxref("String.search", "search")}} و {{jsxref("String.split", "split")}} للكائن {{jsxref("String")}}. يتناول هذا الفصل  تعبيرات جافاسكربت القياسية.</p>
+
+<div id="mdnDiv" style="font-size: 16px;">
+<h2 id="انشاء_تعبير_قياسي_او_ريجكس" style="font-family: tahoma;">انشاء تعبير قياسي او ريجكس</h2>
+
+<p style="font-family: tahoma;">يمكنك انشاء ريجكس من خلال احدى الطرق التالية:</p>
+
+<p dir="rtl" style="font-family: tahoma;">الطريقة الاولى، باستخدام التعبير القياسى الحرفي regular expression literal، ويتضمن الباترن pattern بين سلاشين، كما يلي:</p>
+
+<pre class="brush: js line-numbers language-js" dir="rtl" style="font-family: tahoma;"><code class="language-js"><span class="keyword token">var</span> re <span class="operator token">=</span> <span class="regex token">/ab+c/</span><span class="punctuation token">;</span></code></pre>
+
+<p dir="rtl" style="font-family: tahoma;">يقوم ال Regular expression literals بتجهيز التعبير القياسي عند تحميل السكريبت. شرط ان يظل التعبير القياسي ثابتا، في هذه الحالة، استخدام هذا الشكل المختصر يمكن أن يحسن من الأداء.</p>
+
+<p dir="rtl" style="font-family: tahoma;">الطريقة الثانية، من خلال استدعاء <code>constructor</code> الكائن <code>RegExp</code>، كما يلي:</p>
+
+<pre class="brush: js line-numbers language-js" dir="rtl" style="font-family: tahoma;"><code class="language-js"><span class="keyword token">var</span> re <span class="operator token">=</span> <span class="keyword token">new</span> <span class="class-name token">RegExp</span><span class="punctuation token">(</span><span class="string token">'ab+c'</span><span class="punctuation token">)</span><span class="punctuation token">;</span></code></pre>
+
+<p dir="rtl" style="font-family: tahoma;">استخدام ال constructor، يقلل من وقت تشغيل الريجكس. إسْتخدِم ال  constructor عندما تريد ان يكون الريجكس قابلا للتغيير، او في حالة عدم علمك بالريجكس الذي ستحصل عليه من طرف اخر. كحقل المدخلات مثلا.</p>
+
+<h2 dir="rtl" id="انشاء_باترن_الريجكس" style="font-family: tahoma;">انشاء باترن الريجكس</h2>
+
+<p dir="rtl" style="font-family: tahoma;">يتكون الباترن البسيط اما من رموز عادية، مثل <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-weight: bold; font-family: consolas; background: transparent none repeat scroll 0% 0%;">/abc/</code>، او خليط من الرموز العادية والرموز الخاصة، مثل <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-weight: bold; font-family: consolas; background: transparent none repeat scroll 0% 0%;">/ab*c/</code> او <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-weight: bold; font-family: consolas; background: transparent none repeat scroll 0% 0%;">/Chapter (\d+)\.\d*/</code>. يحتوي هذا الباترن على اقواس هلالية، هذه الاقواس ستقوم بدور ذاكرة الجهاز، بحيث ستقوم بتخزين قيمة المطابقة الناتجة عن هذا الجزء من الباترن وفهرستها ليتم استدعاؤها لاحقا. للمزيد من التفاصيل حول <a href="https://developer.mozilla.org/ar/docs/Web/JavaScript/Guide/Regular_Expressions#Using_parenthesized_substring_matches">مطابقة السلسلة النصية الجزئية بين قوسين</a>.</p>
+
+<h3 class="highlight-spanned" dir="rtl" id="استخدام_الباتر_البسيط" style="font-family: tahoma;"><span class="highlight-span">استخدام الباتر البسيط</span></h3>
+
+<p dir="rtl" style="font-family: tahoma;">تتكون الباترنز البسيطة، من رموز صريحة ومباشرة، تصف فيها ما تريد مقارنته مباشرة. مثلا، الباترن <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-weight: bold; font-family: consolas; background: transparent none repeat scroll 0% 0%;">/abc/</code> سيطابق مجموعة من الرموز في سلسلة نصية، شرط تواجد هذه الرموز جنبا الى جنب بشكل مرتب. لذالك، ستنجح المطابقة في هذه السلسلة النصية <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-family: consolas; font-weight: bold; background: transparent none repeat scroll 0% 0%;">"Hi, do you know your abc's?"</code>  وكذالك في السلسلة النصية التالية <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-family: consolas; font-weight: bold; background: transparent none repeat scroll 0% 0%;">"The latest airplane designs evolved from slabcraft."</code>، نجحت المطابقة في كلتا الحالتين لان السلسلة الفرعية <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-family: consolas; font-weight: bold; background: transparent none repeat scroll 0% 0%;">'abc'</code> هي المطلوبة. وهذا لايتطابق مع هذه السلسلة النصية <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-family: consolas; font-weight: bold; background: transparent none repeat scroll 0% 0%;">'Grab crab'</code> لانها تحتوي على سلسلة نصية غير تلك المطلوبة  <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-family: consolas; font-weight: bold; background: transparent none repeat scroll 0% 0%;">'ab c'</code>.</p>
+
+<h3 class="highlight-spanned" dir="rtl" id="استخدام_الرموز_الخاصة" style="font-family: tahoma;"><span class="highlight-span">استخدام الرموز الخاصة</span></h3>
+
+<p dir="rtl" style="font-family: tahoma;">عندما يتطلب الامر عملية بحث، أكثر من مطابقة صريحة ومباشرة، مثل البحث عن واحد او اكثر من ال <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-family: consolas; font-weight: bold; background: transparent none repeat scroll 0% 0%;">'b'</code>، او البحث عن مسافة فارغة، عندها سيتوجب على الباترن ان يحتوي على الرموز الخاصة. مثلا، الباترن <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-weight: bold; font-family: consolas; background: transparent none repeat scroll 0% 0%;">/ab*c/</code> سيطابق مجموعة من الرموز، حيث ستكون <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-family: consolas; font-weight: bold; background: transparent none repeat scroll 0% 0%;">'a'</code> متبوعة بصفر او اكثر من ال <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-family: consolas; font-weight: bold; background: transparent none repeat scroll 0% 0%;">'b'</code>، الرمز الخاص نجمة <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-weight: bold; font-family: consolas; background: transparent none repeat scroll 0% 0%;">*</code> يرصد وجود العنصر المطلوب صفر او اكثر من المرات، متبوعا مباشرة ب <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-family: consolas; font-weight: bold; background: transparent none repeat scroll 0% 0%;">'c'</code>. بعد فحص السلسلة النصية <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-family: consolas; font-weight: bold; background: transparent none repeat scroll 0% 0%;">"cbbabbbbcdebc,"</code> قام الباترن بمطابقة السلسلة الجزئية <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-family: consolas; font-weight: bold; background: transparent none repeat scroll 0% 0%;">'abbbbc'</code>.</p>
+
+<p style="font-family: tahoma;">يحتوي الجدول التالي على قائمة مكتملة من رموز الريجكس الخاصة وشرحها.</p>
+
+<table class="standard-table" style="font-family: tahoma;">
+ <caption>
+ <p>الرموز الخاصة بالريجكس.</p>
+ </caption>
+ <thead>
+ <tr>
+ <th dir="rtl" scope="col">الرمز</th>
+ <th dir="rtl" scope="col">شرح الاستخدام</th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr>
+ <td dir="rtl"><code><strong><a href="https://developer.mozilla.org/ar/docs/Web/JavaScript/Guide/Regular_Expressions#special-backslash" id="special-backslash" name="special-backslash">\</a></strong></code></td>
+ <td>
+ <p dir="rtl"> </p>
+
+ <p dir="rtl">مطابقات وفقا للقواعد التالية:<br>
+ <br>
+ الباكسلاش الذي يسبق الرمز العادي يشير الى ان الرمز التالي هو رمز من الرموز الخاصة ولا ينبغي تفسيره حرفيا. مثلا <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-family: consolas; font-weight: bold; background: transparent none repeat scroll 0% 0%;">'b'</code> من دون باكسلاش<code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-weight: bold; font-family: consolas; background: transparent none repeat scroll 0% 0%;"> \ </code>، ستطابق <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-family: consolas; font-weight: bold; background: transparent none repeat scroll 0% 0%;">'b'</code> بحروف صغيرة. لكن <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-weight: bold; font-family: consolas; background: transparent none repeat scroll 0% 0%;">\b</code> في حد داتها لا تطابق اي حرف، لانها من الرموز الخاصة وتعني حصر او تحديد حدود للرموز المطلوبة <a href="https://developer.mozilla.org/ar/docs/Web/JavaScript/Guide/Regular_Expressions#special-word-boundary" title="#special-word-boundary">word boundary character</a>.<br>
+ <br>
+ الباكسلاش الذي يسبق الرموز الخاصة، يشير الى ان الرمز التالي هو ليس من الرموز الخاصة وينبغي تفسيره حرفيا. مثلا، الباترن <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-weight: bold; font-family: consolas; background: transparent none repeat scroll 0% 0%;">/a*/</code> يحتوي على احد الرموز الخاصة <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-weight: bold; font-family: consolas; background: transparent none repeat scroll 0% 0%;">*</code> وهو لمطابقة صفر او اكثر من a، بعد اضافة الباكسلاش له، كما في  الباترن <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-weight: bold; font-family: consolas; background: transparent none repeat scroll 0% 0%;">/a\*/</code> تم الغاء رمزيتة، وبالتالي اصبح الباترن  <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-weight: bold; font-family: consolas; background: transparent none repeat scroll 0% 0%;">/a\*/</code> يطابق السلسلة الحرفية <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-family: consolas; font-weight: bold; background: transparent none repeat scroll 0% 0%;">'a*'</code>.<br>
+ <br>
+ لا تنس تهريب الباكسلاش نفسه، بينما تستخدم الكونستراكتر <code>RegExp( "\\s", "g" )</code>، لانه يعمل ايضا، كمهرب للرموز الخاصة في السلسلة النصية.</p>
+
+ <p dir="rtl"> </p>
+ </td>
+ </tr>
+ <tr>
+ <td><code><strong><a href="https://developer.mozilla.org/ar/docs/Web/JavaScript/Guide/Regular_Expressions#special-caret" id="special-caret" name="special-caret">^</a></strong></code></td>
+ <td>
+ <p dir="rtl"> </p>
+
+ <p dir="rtl">مطابقة بداية المدخلات. ادا كان البند <code>multiline</code> ب <code>true</code>، اي ان <strong><code>m</code></strong> موجودة في الباترن <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-weight: bold; font-family: consolas; background: transparent none repeat scroll 0% 0%;">/^a/gm</code> سيبدا البحث عن المطابقة في بداية اي سطر جديد.<br>
+ <br>
+ مثلا الباترن  <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-weight: bold; font-family: consolas; background: transparent none repeat scroll 0% 0%;">/^a/gm</code>  سيطابق اثنان من <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-family: consolas; font-weight: bold; background: transparent none repeat scroll 0% 0%;">'a'</code>، في <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-family: consolas; font-weight: bold; background: transparent none repeat scroll 0% 0%;">"a special char\nacter"</code>، لاحظ وجود السطر الجديد <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-weight: bold; font-family: consolas; background: transparent none repeat scroll 0% 0%;">\n</code> في السلسلة النصية.<br>
+ <br>
+ الرمز <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-weight: bold; font-family: consolas; background: transparent none repeat scroll 0% 0%;">^</code> سيصبح له معنى اخر عندما يستخدم مع المجموعة. <a href="https://developer.mozilla.org/ar/docs/Web/JavaScript/Guide/Regular_Expressions#special-negated-character-set" title="#special-negated-character-set">توجه الى مجموعة الرموز</a> لمعرفة المزيد من التفاصيل.</p>
+
+ <p dir="rtl"> </p>
+ </td>
+ </tr>
+ <tr>
+ <td><strong><code><a href="https://developer.mozilla.org/ar/docs/Web/JavaScript/Guide/Regular_Expressions#special-dollar" id="special-dollar" name="special-dollar">$</a></code></strong></td>
+ <td>
+ <p dir="rtl"> </p>
+
+ <p dir="rtl">مطابقة نهاية المدخلات. ادا كان البند <code>multiline</code>  ب <code>true</code>، اي ان <strong><code>m</code></strong> موجودة في الباترن <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-weight: bold; font-family: consolas; background: transparent none repeat scroll 0% 0%;">/r$/gm</code> سيبدا البحث عن المطابقة في نهاية اي سطر جديد.<br>
+ <br>
+ مثلا الباترن <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-weight: bold; font-family: consolas; background: transparent none repeat scroll 0% 0%;">/r$/gm</code> سيطابق اثنان من <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-family: consolas; font-weight: bold; background: transparent none repeat scroll 0% 0%;">'r'</code>، في <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-family: consolas; font-weight: bold; background: transparent none repeat scroll 0% 0%;">"a special char\nacter"</code>، لاحظ وجود السطر الجديد <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-weight: bold; font-family: consolas; background: transparent none repeat scroll 0% 0%;">\n</code> في السلسلة النصية.</p>
+ </td>
+ </tr>
+ <tr>
+ <td><strong><code><a href="https://developer.mozilla.org/ar/docs/Web/JavaScript/Guide/Regular_Expressions#special-asterisk" id="special-asterisk" name="special-asterisk">*</a></code></strong></td>
+ <td>
+ <p dir="rtl"> </p>
+
+ <p dir="rtl">مطابقة التعبير الذي سيسبق الرمز <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-weight: bold; font-family: consolas; background: transparent none repeat scroll 0% 0%;">*</code> صفر او اكثر من المرات، وهو مكافئ ل <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-weight: bold; font-family: consolas; background: transparent none repeat scroll 0% 0%;">{0,}</code>.</p>
+
+ <p dir="rtl">مثلا، <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-weight: bold; font-family: consolas; background: transparent none repeat scroll 0% 0%;">/bo*/</code> سيطابق <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-family: consolas; font-weight: bold; background: transparent none repeat scroll 0% 0%;">'boooo'</code> في <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-family: consolas; font-weight: bold; background: transparent none repeat scroll 0% 0%;">"A ghost booooed"</code> و <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-family: consolas; font-weight: bold; background: transparent none repeat scroll 0% 0%;">'b'</code> في <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-family: consolas; font-weight: bold; background: transparent none repeat scroll 0% 0%;">"A bird warbled"</code> لكن لا شئ بالنسبة ل <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-family: consolas; font-weight: bold; background: transparent none repeat scroll 0% 0%;">"A goat grunted"</code>.</p>
+
+ <p dir="rtl"> </p>
+ </td>
+ </tr>
+ <tr>
+ <td><strong><code><a href="https://developer.mozilla.org/ar/docs/Web/JavaScript/Guide/Regular_Expressions#special-plus" id="special-plus" name="special-plus">+</a></code></strong></td>
+ <td>
+ <p dir="rtl"> </p>
+
+ <p dir="rtl">مطابقة التعبير الذي سيسبق الرمز <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-weight: bold; font-family: consolas; background: transparent none repeat scroll 0% 0%;">+</code> مرة واحدة على الاقل او اكثر من المرات، وهو مكافئ ل <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-weight: bold; font-family: consolas; background: transparent none repeat scroll 0% 0%;">{1,}</code>.</p>
+
+ <p dir="rtl">مثلا، <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-weight: bold; font-family: consolas; background: transparent none repeat scroll 0% 0%;">/a+/</code> ستطابق <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-family: consolas; font-weight: bold; background: transparent none repeat scroll 0% 0%;">'a'</code> في <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-family: consolas; font-weight: bold; background: transparent none repeat scroll 0% 0%;">"candy"</code> ومجموعة ال  <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-family: consolas; font-weight: bold; background: transparent none repeat scroll 0% 0%;">'a'</code> في <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-family: consolas; font-weight: bold; background: transparent none repeat scroll 0% 0%;">"caaaaaaandy"</code> لكن لا شئ بالنسبة ل <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-family: consolas; font-weight: bold; background: transparent none repeat scroll 0% 0%;">"cndy"</code>.</p>
+
+ <p dir="rtl"> </p>
+ </td>
+ </tr>
+ <tr>
+ <td><strong><code><a href="https://developer.mozilla.org/ar/docs/Web/JavaScript/Guide/Regular_Expressions#special-questionmark" id="special-questionmark" name="special-questionmark">?</a></code></strong></td>
+ <td dir="rtl">
+ <p> </p>
+
+ <p>مطابقة التعبير الذي سيسبق الرمز <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-weight: bold; font-family: consolas; background: transparent none repeat scroll 0% 0%;">?</code> صفر او واحد من المرات، وهو مكافئ ل <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-weight: bold; font-family: consolas; background: transparent none repeat scroll 0% 0%;">{0,1}</code>.<br>
+ <br>
+ مثلا، الباترن <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-weight: bold; font-family: consolas; background: transparent none repeat scroll 0% 0%;">/e?le?/</code> سيطابق <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-family: consolas; font-weight: bold; background: transparent none repeat scroll 0% 0%;">'el'</code> في <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-family: consolas; font-weight: bold; background: transparent none repeat scroll 0% 0%;">"angel"</code> و <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-family: consolas; font-weight: bold; background: transparent none repeat scroll 0% 0%;">'le'</code> في <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-family: consolas; font-weight: bold; background: transparent none repeat scroll 0% 0%;">"angle"</code> وكذالك <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-family: consolas; font-weight: bold; background: transparent none repeat scroll 0% 0%;">'l'</code> في <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-family: consolas; font-weight: bold; background: transparent none repeat scroll 0% 0%;">"also"</code>.<br>
+ <br>
+ اذا استخدم الرمز <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-weight: bold; font-family: consolas; background: transparent none repeat scroll 0% 0%;">?</code> مباشرة بعد احد هذه المحددات <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-weight: bold; font-family: consolas; background: transparent none repeat scroll 0% 0%;">*</code>، <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-weight: bold; font-family: consolas; background: transparent none repeat scroll 0% 0%;">+</code>، <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-weight: bold; font-family: consolas; background: transparent none repeat scroll 0% 0%;">?</code>، او <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-weight: bold; font-family: consolas; background: transparent none repeat scroll 0% 0%;">{}</code>، سيؤثر على سلوكها الافتراضي، فيجعلها<strong> غير</strong> <strong>طماعة</strong> <code>non-greedy</code> او<strong> غير</strong> <strong>جشعة</strong> (تطابق عدد محدود من الاحرف) بخلاف سلوكها الافتراضي، وهو التصرف <strong>بجشع</strong> (تطابق اكثر عدد ممكن من الاحرف)، مثلا، باستخدام الباترن الجشع، <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-weight: bold; font-family: consolas; background: transparent none repeat scroll 0% 0%;">/\d+/</code> ستطابق كل السلسلة <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-family: consolas; font-weight: bold; background: transparent none repeat scroll 0% 0%;">"123"</code> في <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-family: consolas; font-weight: bold; background: transparent none repeat scroll 0% 0%;">"123abc"</code> . اما باستخدام الباترن الغير جشع، <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-weight: bold; font-family: consolas; background: transparent none repeat scroll 0% 0%;">/\d+?/</code> وعلى نفس السلسلة ستطابق <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-family: consolas; font-weight: bold; background: transparent none repeat scroll 0% 0%;">"1"</code> فقط.<br>
+ <br>
+ مثال اكثر دقة حول <code>non-greedy</code> و <code>greedy</code>، فرضا، نريد مطابقة تاجات الاتش تي ام ال، باستخدام الباترن الجشع <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-weight: bold; font-family: consolas; background: transparent none repeat scroll 0% 0%;"> /&lt;(.+)&gt;/g</code> سيتم مطابقة كل السلسلة النصية <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-family: consolas; font-weight: bold; background: transparent none repeat scroll 0% 0%;">"&lt;div&gt;fCh&lt;p&gt;elema&lt;/p&gt;lCh&lt;/div&gt;"</code>، اما باستخدام الباترن الغير شجع <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-weight: bold; font-family: consolas; background: transparent none repeat scroll 0% 0%;"> /&lt;(.+?)&gt;/g</code> فسيتم مطابقة التاجات ومحتواها فقط. بمعنى، ان العملية ستسير بالشكل التالي: مع بداية البحث، عندما سيجد التاج الاول <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-family: consolas; font-weight: bold; background: transparent none repeat scroll 0% 0%;">'&lt;div&gt;'</code> سييكتفي به ولا يطمع في ما يليه، ثم ينتقل مباشرة نحو الهدف الثاني <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-family: consolas; font-weight: bold; background: transparent none repeat scroll 0% 0%;">'&lt;p&gt;'</code> فيطابقه ويكتفي به دون ان يطمع في ما يليه، وهكذا. مع العلم ان الباترن عبارة عن البحث <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-weight: bold; font-family: consolas; background: transparent none repeat scroll 0% 0%;">(.+?)</code> في كل شئ، لكن من دون طمع.<br>
+ الرمز <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-weight: bold; font-family: consolas; background: transparent none repeat scroll 0% 0%;">?</code> يصبح له معنى اخر مع <em><code>lookahead assertions</code></em>، النظر الى الامام <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-weight: bold; font-family: consolas; background: transparent none repeat scroll 0% 0%;">x(?=y)</code> ومنع النظر الى الامام <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-weight: bold; font-family: consolas; background: transparent none repeat scroll 0% 0%;">x(?!y)</code> سيتم شرحها في هذا الجدول.</p>
+
+ <p> </p>
+ </td>
+ </tr>
+ <tr>
+ <td><strong><code><a href="https://developer.mozilla.org/ar/docs/Web/JavaScript/Guide/Regular_Expressions#special-dot" id="special-dot" name="special-dot">.</a></code></strong></td>
+ <td>
+ <p> </p>
+
+ <p>النقطة الكسرية تطابق اي شئ، ما عدا السطر الجديد</p>
+
+ <p dir="rtl">مثلا، <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-weight: bold; font-family: consolas; background: transparent none repeat scroll 0% 0%;">/.n/</code> ستطابق <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-family: consolas; font-weight: bold; background: transparent none repeat scroll 0% 0%;">'an'</code> و <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-family: consolas; font-weight: bold; background: transparent none repeat scroll 0% 0%;">'on'</code> في <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-family: consolas; font-weight: bold; background: transparent none repeat scroll 0% 0%;">"nay, an apple is on the tree"</code>, لكن ليس <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-family: consolas; font-weight: bold; background: transparent none repeat scroll 0% 0%;">'nay'</code>.</p>
+
+ <p dir="rtl"> </p>
+ </td>
+ </tr>
+ <tr>
+ <td><strong><code><a href="https://developer.mozilla.org/ar/docs/Web/JavaScript/Guide/Regular_Expressions#special-capturing-parentheses" id="special-capturing-parentheses" name="special-capturing-parentheses">(x)</a></code></strong></td>
+ <td>
+ <p dir="rtl"> </p>
+
+ <p dir="rtl">مطابقة <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-family: consolas; font-weight: bold; background: transparent none repeat scroll 0% 0%;">'x'</code> وانشاء فهرسة جزئية. كما يبين المثال التالى. اقواس المجموعة المفهرسة تسمى <code><em>capturing parentheses</em></code>.<br>
+ <br>
+ مثلا،<code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-weight: bold; font-family: consolas; background: transparent none repeat scroll 0% 0%;">'(foo)'</code> و <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-weight: bold; font-family: consolas; background: transparent none repeat scroll 0% 0%;">'(bar)'</code> في الباترن <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-weight: bold; font-family: consolas; background: transparent none repeat scroll 0% 0%;">/(foo) (bar) \1 \2/</code> تطابق وتفهرس الكلمة الاولى والكلمة الثانية في السلسلة الحرفية <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-family: consolas; font-weight: bold; background: transparent none repeat scroll 0% 0%;">"foo bar foo bar"</code>. والفهرسة الرقمية <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-weight: bold; font-family: consolas; background: transparent none repeat scroll 0% 0%;">\1</code> و <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-weight: bold; font-family: consolas; background: transparent none repeat scroll 0% 0%;">\2</code>  تولد الكلمة الثالثة والكلمة الرابعة بناءا على الاقواس المحيطة بكل منهما. تذكر ان هذه الفهرسة الرقمية تستخدم داخل الباترن فقط. فيما تستخدم المتغيرات السحررية <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-weight: bold; font-family: consolas; background: transparent none repeat scroll 0% 0%;">$1</code>, <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-weight: bold; font-family: consolas; background: transparent none repeat scroll 0% 0%;">$2</code>, ..., <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-weight: bold; font-family: consolas; background: transparent none repeat scroll 0% 0%;">$n</code> خارج الباترن، وتستخدم في عملية الاستبدال فقط، مثلا، <code>'bar foo'.replace(/(...) (...)/, '$2 $1')</code>.  <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-weight: bold; font-family: consolas; background: transparent none repeat scroll 0% 0%;">$&amp;</code> يطابق هذا المتغير السحري <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-weight: bold; font-family: consolas; background: transparent none repeat scroll 0% 0%;">$&amp;</code> السلسلة النصية بالكامل، او بمعنى اصح، ينقل ناتج الباترن بالكامل.</p>
+
+ <p dir="rtl"> </p>
+ </td>
+ </tr>
+ <tr>
+ <td dir="rtl"><strong><code><a href="https://developer.mozilla.org/ar/docs/Web/JavaScript/Guide/Regular_Expressions#special-non-capturing-parentheses" id="special-non-capturing-parentheses" name="special-non-capturing-parentheses">(x:?)</a></code></strong></td>
+ <td dir="rtl">
+ <p> </p>
+
+ <p>مطابقة ال <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-family: consolas; font-weight: bold; background: transparent none repeat scroll 0% 0%;">'x'</code> لكن دون انشاء جزئية مفهرسة، اقواس المجموعة هنا تسمى <code><em>non-capturing parentheses</em></code></p>
+
+ <p>انشاء جزئية مفهرسة وعدم استخدامها، يبطئ من سرعة محرك الريجكس، لانه يتسبب له في عمل زائد، يمكنك جعل محرك الريجكس اسرع قليلا باستخدام <code><em>non-capturing</em></code>.</p>
+
+ <p>علامة الاستفهام والنقطتين بعد قوس الافتتاح هما من الرموز الخاصة، استخدامهما جنبا الى جنب يخبر محرك الريجكس بان هذه المجموعة لا ينبغي ان تعامل كجزئية مفهرسة. وبالتالي لا يمكن، استدعاء المطابقة من خلال الفهرسة الرقمية<code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-weight: bold; font-family: consolas; background: transparent none repeat scroll 0% 0%;">\1...</code> او عناصر المصفوفة <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-weight: bold; font-family: consolas; background: transparent none repeat scroll 0% 0%;">[1]...</code> او اعادة استخدام المطابقة من خلال المتغيرات السحرية <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-weight: bold; font-family: consolas; background: transparent none repeat scroll 0% 0%;">$1...$9</code>.</p>
+
+ <p> </p>
+ </td>
+ </tr>
+ <tr>
+ <td><strong><code><a href="https://developer.mozilla.org/ar/docs/Web/JavaScript/Guide/Regular_Expressions#special-lookahead" id="special-lookahead" name="special-lookahead">=</a>?</code></strong></td>
+ <td>
+ <p dir="rtl"> </p>
+
+ <p dir="rtl">مطابقة ال <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-family: consolas; font-weight: bold; background: transparent none repeat scroll 0% 0%;">'x'</code> فقط اذا كانت <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-family: consolas; font-weight: bold; background: transparent none repeat scroll 0% 0%;">'x'</code> متبوعة ب <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-family: consolas; font-weight: bold; background: transparent none repeat scroll 0% 0%;">'y'</code>. وهذا يسمى النظر الى الامام<code> <em>lookahead</em></code>.</p>
+
+ <p dir="rtl">مثلا، <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-weight: bold; font-family: consolas; background: transparent none repeat scroll 0% 0%;">/Jack(?=Sprat)/</code> سيطابق <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-family: consolas; font-weight: bold; background: transparent none repeat scroll 0% 0%;">'Jack'</code> فقط اذا كان متبوعا ب <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-family: consolas; font-weight: bold; background: transparent none repeat scroll 0% 0%;">'Sprat'</code>. وكذالك بالنسبة ل <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-weight: bold; font-family: consolas; background: transparent none repeat scroll 0% 0%;">/Jack(?=Sprat|Frost)/</code> سيطابق <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-family: consolas; font-weight: bold; background: transparent none repeat scroll 0% 0%;">'Jack'</code> فقط اذا كان متبوعا ب <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-family: consolas; font-weight: bold; background: transparent none repeat scroll 0% 0%;">'Sprat'</code> او <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-family: consolas; font-weight: bold; background: transparent none repeat scroll 0% 0%;">'Frost'</code>. ومع ذالك، لا <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-family: consolas; font-weight: bold; background: transparent none repeat scroll 0% 0%;">'Sprat'</code> ولا <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-family: consolas; font-weight: bold; background: transparent none repeat scroll 0% 0%;">'Frost'</code> جزء من ناتج المطابقة.</p>
+
+ <p dir="rtl"> </p>
+ </td>
+ </tr>
+ <tr>
+ <td><strong><code>!?</code></strong></td>
+ <td>
+ <p dir="rtl"> </p>
+
+ <p dir="rtl">مطابقة ال <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-family: consolas; font-weight: bold; background: transparent none repeat scroll 0% 0%;">'x'</code> فقط اذا كانت <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-family: consolas; font-weight: bold; background: transparent none repeat scroll 0% 0%;">'x'</code> غير متبوعة ب <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-family: consolas; font-weight: bold; background: transparent none repeat scroll 0% 0%;">'y'</code>. وهذا يسمى منع او ابطال النظر الى الامام <code><em>negated lookahead</em></code>.</p>
+
+ <p dir="rtl">مثلا، <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-weight: bold; font-family: consolas; background: transparent none repeat scroll 0% 0%;">/\d+(?!\.)/</code> سيطابق عدد فقط اذا كان غير متبوعا بفاصلة كسرية. الريجكس <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-weight: bold; font-family: consolas; background: transparent none repeat scroll 0% 0%;">/\d+(?!\.)/.exec("3.141")</code> سيطابق <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-family: consolas; font-weight: bold; background: transparent none repeat scroll 0% 0%;">'141'</code> لكن لن يطابق <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-family: consolas; font-weight: bold; background: transparent none repeat scroll 0% 0%;">'3.141'</code>.</p>
+
+ <p dir="rtl"> </p>
+ </td>
+ </tr>
+ <tr>
+ <td><strong><code><a href="https://developer.mozilla.org/ar/docs/Web/JavaScript/Guide/Regular_Expressions#special-or" id="special-or" name="special-or">x|y</a></code></strong></td>
+ <td>
+ <p dir="rtl"> </p>
+
+ <p dir="rtl">مطابقة <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-family: consolas; font-weight: bold; background: transparent none repeat scroll 0% 0%;">'x'</code> أو <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-family: consolas; font-weight: bold; background: transparent none repeat scroll 0% 0%;">'y'</code>.</p>
+
+ <p dir="rtl">مثلا، <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-weight: bold; font-family: consolas; background: transparent none repeat scroll 0% 0%;">/green|red/</code> سيطابق <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-family: consolas; font-weight: bold; background: transparent none repeat scroll 0% 0%;">'green'</code> في <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-family: consolas; font-weight: bold; background: transparent none repeat scroll 0% 0%;">"green apple"</code> و <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-family: consolas; font-weight: bold; background: transparent none repeat scroll 0% 0%;">'red'</code> في <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-family: consolas; font-weight: bold; background: transparent none repeat scroll 0% 0%;">"red apple."</code>.</p>
+
+ <p dir="rtl"> </p>
+ </td>
+ </tr>
+ <tr>
+ <td><strong><code><a href="https://developer.mozilla.org/ar/docs/Web/JavaScript/Guide/Regular_Expressions#special-quantifier" id="special-quantifier" name="special-quantifier">{n}</a></code></strong></td>
+ <td dir="rtl">
+ <p> </p>
+
+ <p>مطابقة n تحديدا، بناءا على التعبير الذي سيسبقه. n يجب ان يكون عددا صحيحا.<br>
+ <br>
+ مثلا، <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-weight: bold; font-family: consolas; background: transparent none repeat scroll 0% 0%;">/a{2}/</code> لن يطابق <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-family: consolas; font-weight: bold; background: transparent none repeat scroll 0% 0%;">'a'</code>في <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-family: consolas; font-weight: bold; background: transparent none repeat scroll 0% 0%;">"candy,"</code> لكنه سيطابق جميع ال a في <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-family: consolas; font-weight: bold; background: transparent none repeat scroll 0% 0%;">"caandy,"</code> كما سيطابق اثنان من ال a الاولى في <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-family: consolas; font-weight: bold; background: transparent none repeat scroll 0% 0%;">"caaandy."</code>.</p>
+
+ <p> </p>
+ </td>
+ </tr>
+ <tr>
+ <td><strong><code><a href="https://developer.mozilla.org/ar/docs/Web/JavaScript/Guide/Regular_Expressions#special-quantifier" id="special-quantifier" name="special-quantifier">{n,}</a></code></strong></td>
+ <td>
+ <p dir="rtl"> </p>
+
+ <p dir="rtl">مطابقة n او اكثر، بناءا على التعبير الذي سيسبقه. n يجب ان يكون عددا صحيحا.</p>
+
+ <p dir="rtl">مثلا، <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-weight: bold; font-family: consolas; background: transparent none repeat scroll 0% 0%;">/a{2,}/</code> سيطابق <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-family: consolas; font-weight: bold; background: transparent none repeat scroll 0% 0%;">"aa"</code> ، <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-family: consolas; font-weight: bold; background: transparent none repeat scroll 0% 0%;">"aaaa"</code> و <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-family: consolas; font-weight: bold; background: transparent none repeat scroll 0% 0%;">"aaaaa"</code> لكن ليس <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-family: consolas; font-weight: bold; background: transparent none repeat scroll 0% 0%;">"a"</code>.</p>
+
+ <p dir="rtl"> </p>
+ </td>
+ </tr>
+ <tr>
+ <td><strong><code><a href="https://developer.mozilla.org/ar/docs/Web/JavaScript/Guide/Regular_Expressions#special-quantifier-range" id="special-quantifier-range" name="special-quantifier-range">{n,m}</a></code></strong></td>
+ <td>
+ <p dir="rtl"> </p>
+
+ <p dir="rtl">حيث ان <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-weight: bold; font-family: consolas; background: transparent none repeat scroll 0% 0%;">n</code> و <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-weight: bold; font-family: consolas; background: transparent none repeat scroll 0% 0%;">m</code> من الاعداد الصحيحة الموجبة، و <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-weight: bold; font-family: consolas; background: transparent none repeat scroll 0% 0%;">n &lt;= m</code>. فستكون المطابقة من <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-weight: bold; font-family: consolas; background: transparent none repeat scroll 0% 0%;">n</code> الى <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-weight: bold; font-family: consolas; background: transparent none repeat scroll 0% 0%;">m</code>، بناءا على التعبير الذي سيسبقها.</p>
+
+ <p dir="rtl">مثلا، <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-weight: bold; font-family: consolas; background: transparent none repeat scroll 0% 0%;">/a{1,3}/</code> لن يطابق شئ في <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-family: consolas; font-weight: bold; background: transparent none repeat scroll 0% 0%;">"cndy"</code> لكنه سيطابق <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-family: consolas; font-weight: bold; background: transparent none repeat scroll 0% 0%;">'a'</code> في <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-family: consolas; font-weight: bold; background: transparent none repeat scroll 0% 0%;">"candy,"</code> وكذاك اثنان من ال <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-family: consolas; font-weight: bold; background: transparent none repeat scroll 0% 0%;">'a'</code> الاولى في <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-family: consolas; font-weight: bold; background: transparent none repeat scroll 0% 0%;">"caandy,"</code> وايضا الثلاثة <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-family: consolas; font-weight: bold; background: transparent none repeat scroll 0% 0%;">"a"</code> الاولى في <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-family: consolas; font-weight: bold; background: transparent none repeat scroll 0% 0%;">"caaaaaaandy"</code>. لاحظ عند مطابقة <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-family: consolas; font-weight: bold; background: transparent none repeat scroll 0% 0%;">"caaaaaaandy"</code> تم مطابقة <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-family: consolas; font-weight: bold; background: transparent none repeat scroll 0% 0%;">"aaa"</code> فقط، بالرغم من احتواء السلسة النصية على اكثر من ذالك.</p>
+
+ <p dir="rtl"> </p>
+ </td>
+ </tr>
+ <tr>
+ <td><strong><code><a href="https://developer.mozilla.org/ar/docs/Web/JavaScript/Guide/Regular_Expressions#special-character-set" id="special-character-set" name="special-character-set">[xyz]</a></code></strong></td>
+ <td dir="rtl">
+ <p> </p>
+
+ <p>المجموعة، او مجموعة الرموز، هذا النوع من الباترن يطابق اي رموز داخل الاقواس المعقوفة، بما فيها المهربات المتتالية <a href="https://developer.mozilla.org/en-US/docs/JavaScript/Guide/Values,_variables,_and_literals#Unicode_escape_sequences" title="https://developer.mozilla.org/en-US/docs/JavaScript/Guide/Values,_variables,_and_literals#Unicode_escape_sequences">escape sequences</a>. الرموز الخاصة مثل النقطة (<code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-weight: bold; font-family: consolas; background: transparent none repeat scroll 0% 0%;">.</code>) والنجمة (<code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-weight: bold; font-family: consolas; background: transparent none repeat scroll 0% 0%;">*</code>) تصبح رموز عادية شانها شان اي حرف في سلسلة نصية، لذالك فهي لا تحتاج لباكسلاش. يمكنك تحديد منظم الرموز وفصله بشرطة، كما يبين المثال التالي:<br>
+ <br>
+ الباترن<code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-weight: bold; font-family: consolas; background: transparent none repeat scroll 0% 0%;"> [a-d]</code> سيطابق نفس ما سيطابقه الباترن <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-weight: bold; font-family: consolas; background: transparent none repeat scroll 0% 0%;">[abcd]</code> سيطابقان <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-family: consolas; font-weight: bold; background: transparent none repeat scroll 0% 0%;">'b'</code> في <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-family: consolas; font-weight: bold; background: transparent none repeat scroll 0% 0%;">"brisket"</code> و <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-family: consolas; font-weight: bold; background: transparent none repeat scroll 0% 0%;">'c'</code> في <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-family: consolas; font-weight: bold; background: transparent none repeat scroll 0% 0%;">"city"</code>. وكذالك بالنسبة للباترن <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-weight: bold; font-family: consolas; background: transparent none repeat scroll 0% 0%;">/[a-z.]+/</code> و <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-weight: bold; font-family: consolas; background: transparent none repeat scroll 0% 0%;">/[\w.]+/</code> بامكانهما مطابقة كامل السلسلة النصية <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-family: consolas; font-weight: bold; background: transparent none repeat scroll 0% 0%;">"test.i.ng"</code>.</p>
+
+ <p> </p>
+ </td>
+ </tr>
+ <tr>
+ <td><strong><code><a href="https://developer.mozilla.org/ar/docs/Web/JavaScript/Guide/Regular_Expressions#special-negated-character-set" id="special-negated-character-set" name="special-negated-character-set">[xyz^</a><a href="https://developer.mozilla.org/ar/docs/Web/JavaScript/Guide/Regular_Expressions#special-negated-character-set" name="special-negated-character-set">]</a></code></strong></td>
+ <td>
+ <p dir="rtl"> </p>
+
+ <p dir="rtl">منع مجموعة من الرموز او رموز معينة. سيتم مطابقة اي شئ ما عد ما ورد داخل الاقواس المعقوفة، يمكنك تحديد منظم الرموز وفصله بشرطة، جميع ما يمكن استخدامه في المجموعة او مجموعة الرموز العادية يمكن استخدامه هنا.</p>
+
+ <p dir="rtl">مثلا، الباترن <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-weight: bold; font-family: consolas; background: transparent none repeat scroll 0% 0%;">[^abc]</code> هو نفسه <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-weight: bold; font-family: consolas; background: transparent none repeat scroll 0% 0%;">[^a-c]</code>. سيطابقان <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-family: consolas; font-weight: bold; background: transparent none repeat scroll 0% 0%;">'r'</code> في <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-family: consolas; font-weight: bold; background: transparent none repeat scroll 0% 0%;">"brisket"</code> و <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-family: consolas; font-weight: bold; background: transparent none repeat scroll 0% 0%;">'h'</code> في <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-family: consolas; font-weight: bold; background: transparent none repeat scroll 0% 0%;">"chop."</code></p>
+
+ <p dir="rtl"> </p>
+ </td>
+ </tr>
+ <tr>
+ <td><strong><code><a href="https://developer.mozilla.org/ar/docs/Web/JavaScript/Guide/Regular_Expressions#special-backspace" id="special-backspace" name="special-backspace">[b\</a><a href="https://developer.mozilla.org/ar/docs/Web/JavaScript/Guide/Regular_Expressions#special-backspace" name="special-backspace">]</a></code></strong></td>
+ <td dir="rtl">
+ <p> </p>
+
+ <p>سيطابق backspace (U+0008). اذا كنت ترغب بمطابقة الرمز النصي: رجوع الى الخلف literal backspace character. فمن الضروري استخدام الاقواس المعقوفة، حتى لا تتعارض مع <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-weight: bold; font-family: consolas; background: transparent none repeat scroll 0% 0%;">\b</code>.</p>
+
+ <p> </p>
+ </td>
+ </tr>
+ <tr>
+ <td><strong><code><a href="https://developer.mozilla.org/ar/docs/Web/JavaScript/Guide/Regular_Expressions#special-word-boundary" id="special-word-boundary" name="special-word-boundary">b\</a></code></strong></td>
+ <td>
+ <p dir="rtl"> </p>
+
+ <p dir="rtl">مطابقة حدود الكلمة <em><code>word boundary</code></em>.</p>
+
+ <p dir="rtl"><code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-weight: bold; font-family: consolas; background: transparent none repeat scroll 0% 0%;">\b</code>، ستطابق الكلمة التي لايسبقها ولا يليها اي من، ما ورد في هذه المجموعة <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-weight: bold; font-family: consolas; background: transparent none repeat scroll 0% 0%;">[A-Za-z0-9_]</code> او في مثيلتها <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-weight: bold; font-family: consolas; background: transparent none repeat scroll 0% 0%;">\w</code>، بمعنى ادق، ستقبل بوجود المسافة الفارغة والرموز النصية الخاصة مثل <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-family: consolas; font-weight: bold; background: transparent none repeat scroll 0% 0%;">"&amp;=)é'?*-"</code> ، اي، كل ما يمكن ان ينتج عن هذه المجموعة <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-weight: bold; font-family: consolas; background: transparent none repeat scroll 0% 0%;">[^A-Za-z0-9_]</code> او عن مثيلتها <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-weight: bold; font-family: consolas; background: transparent none repeat scroll 0% 0%;">\W</code>، اما من قبل او من بعد المطابقة، او من كلا الجانبين، او ان تكون في بداية السلسلة او نهايتها. لاحظ ان ال <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-weight: bold; font-family: consolas; background: transparent none repeat scroll 0% 0%;">\b</code> ليست جزءا من المطابقة. بل للدلالة فقط. وايضا لا تتعارض مع <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-weight: bold; font-family: consolas; background: transparent none repeat scroll 0% 0%;">[\b]</code>.</p>
+
+ <p dir="rtl">امثلة مختلفة:<br>
+ <br>
+ <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-weight: bold; font-family: consolas; background: transparent none repeat scroll 0% 0%;">/\bm/</code> ستطابق <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-family: consolas; font-weight: bold; background: transparent none repeat scroll 0% 0%;">'m'</code> في <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-family: consolas; font-weight: bold; background: transparent none repeat scroll 0% 0%;">"moon"</code>.<br>
+ <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-weight: bold; font-family: consolas; background: transparent none repeat scroll 0% 0%;">/oo\b/</code> لن تطابق <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-family: consolas; font-weight: bold; background: transparent none repeat scroll 0% 0%;">'oo'</code> في <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-family: consolas; font-weight: bold; background: transparent none repeat scroll 0% 0%;">"moon"</code> لان <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-family: consolas; font-weight: bold; background: transparent none repeat scroll 0% 0%;">'oo'</code> متبوعة بالكلمة الرمزية <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-family: consolas; font-weight: bold; background: transparent none repeat scroll 0% 0%;">'n'</code>.<br>
+ <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-weight: bold; font-family: consolas; background: transparent none repeat scroll 0% 0%;">/oon\b/</code> ستطابق <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-family: consolas; font-weight: bold; background: transparent none repeat scroll 0% 0%;">'oon'</code> في <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-family: consolas; font-weight: bold; background: transparent none repeat scroll 0% 0%;">"moon"</code>، لان <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-family: consolas; font-weight: bold; background: transparent none repeat scroll 0% 0%;">'oon'</code> هو نهاية السلسلة النصية، وبالتالي ليست متبوعة باية كلمة رمزية.<br>
+ <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-weight: bold; font-family: consolas; background: transparent none repeat scroll 0% 0%;">/\w\b\w/</code> لن يطابق اي شئ، لان <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-weight: bold; font-family: consolas; background: transparent none repeat scroll 0% 0%;">\w</code> لايمكنها ابدا ان تكون متبوعة ب <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-weight: bold; font-family: consolas; background: transparent none repeat scroll 0% 0%;">\b</code> و <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-weight: bold; font-family: consolas; background: transparent none repeat scroll 0% 0%;">\w</code>.</p>
+
+ <div class="note" dir="rtl">
+ <p><strong>ملاحظة:</strong> محرك الريجكس في الجافاسكريبت حدد بالتدقيق <a class="external external-icon" href="http://www.ecma-international.org/ecma-262/5.1/#sec-15.10.2.6" rel="noopener">مجموعة الرموز</a> على ان تكون <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-family: consolas; font-weight: bold; background: transparent none repeat scroll 0% 0%;">"كلمات"</code> رمزية. أي حرف ليس في تلك المجموعة يعتبر كلمة مكسورة. هذه المجموعة من الأحرف محدودة إلى حد ما: وهي تتألف فقط من الأبجدية الرومانية في كلتا الحروف الصغيرة والحروف الكبيرة، والاعداد العشرية، والرمز underscore. الحروف المعلمة مثل <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-family: consolas; font-weight: bold; background: transparent none repeat scroll 0% 0%;">"é"</code> او <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-family: consolas; font-weight: bold; background: transparent none repeat scroll 0% 0%;">"ü"</code> ، لسوء الحظ عوملت ككلمات مكسورة.</p>
+
+ <p> </p>
+ </div>
+ </td>
+ </tr>
+ <tr>
+ <td><strong><code><a href="https://developer.mozilla.org/ar/docs/Web/JavaScript/Guide/Regular_Expressions#special-non-word-boundary" id="special-non-word-boundary" name="special-non-word-boundary">B\</a></code></strong></td>
+ <td>
+ <p dir="rtl"> </p>
+
+ <p dir="rtl">ال <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-weight: bold; font-family: consolas; background: transparent none repeat scroll 0% 0%;">non-word boundary</code><code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-weight: bold; font-family: consolas; background: transparent none repeat scroll 0% 0%;">\B</code>. عكس ما يمكن لل <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-weight: bold; font-family: consolas; background: transparent none repeat scroll 0% 0%;">\b</code> ان تقوم به.</p>
+
+ <p dir="rtl">مثلا، <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-weight: bold; font-family: consolas; background: transparent none repeat scroll 0% 0%;">/\B../</code> ستطابق <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-family: consolas; font-weight: bold; background: transparent none repeat scroll 0% 0%;">'oo'</code> في <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-family: consolas; font-weight: bold; background: transparent none repeat scroll 0% 0%;">"noonday"</code>، <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-weight: bold; font-family: consolas; background: transparent none repeat scroll 0% 0%;">/y\B./</code> ستطابق <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-family: consolas; font-weight: bold; background: transparent none repeat scroll 0% 0%;">'ye'</code> في <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-family: consolas; font-weight: bold; background: transparent none repeat scroll 0% 0%;">"possibly yesterday"</code>.</p>
+
+ <p dir="rtl"> </p>
+ </td>
+ </tr>
+ <tr>
+ <td><strong><code><a href="https://developer.mozilla.org/ar/docs/Web/JavaScript/Guide/Regular_Expressions#special-control" id="special-control" name="special-control">cX\</a></code></strong></td>
+ <td>
+ <p dir="rtl"> </p>
+
+ <p dir="rtl">حيث ان <em>X</em> هو منظم الرموز من A الى Z. يطابق رمز عنصر التحكم في سلسلة نصية. مثلا،</p>
+
+ <p dir="rtl">مثلا، <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-weight: bold; font-family: consolas; background: transparent none repeat scroll 0% 0%;">/\cM/</code> سيطابق control-M (U+000D) في السلسلة النصية.</p>
+
+ <p dir="rtl"> </p>
+ </td>
+ </tr>
+ <tr>
+ <td><strong><code><a href="https://developer.mozilla.org/ar/docs/Web/JavaScript/Guide/Regular_Expressions#special-digit" id="special-digit" name="special-digit">d\</a></code></strong></td>
+ <td>
+ <p dir="rtl"> </p>
+
+ <p dir="rtl">مطابقة الاعداد. ويكافئ الباترن <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-weight: bold; font-family: consolas; background: transparent none repeat scroll 0% 0%;">[0-9]</code>.</p>
+
+ <p dir="rtl">مثلا، <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-weight: bold; font-family: consolas; background: transparent none repeat scroll 0% 0%;">/\d/</code> او <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-weight: bold; font-family: consolas; background: transparent none repeat scroll 0% 0%;">/[0-9]/</code> ستطابق <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-family: consolas; font-weight: bold; background: transparent none repeat scroll 0% 0%;">'2'</code> في <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-family: consolas; font-weight: bold; background: transparent none repeat scroll 0% 0%;">"B2 is the suite number."</code>.</p>
+
+ <p dir="rtl"> </p>
+ </td>
+ </tr>
+ <tr>
+ <td><strong><code><a href="https://developer.mozilla.org/ar/docs/Web/JavaScript/Guide/Regular_Expressions#special-non-digit" id="special-non-digit" name="special-non-digit">D\</a></code></strong></td>
+ <td>
+ <p> </p>
+
+ <p>مطابقة كل شئ ما عدا الاعداد. ويكافئ الباترن <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-weight: bold; font-family: consolas; background: transparent none repeat scroll 0% 0%;">[^0-9]</code>.</p>
+
+ <p dir="rtl">مثلا، <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-weight: bold; font-family: consolas; background: transparent none repeat scroll 0% 0%;">/\D/</code> او <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-weight: bold; font-family: consolas; background: transparent none repeat scroll 0% 0%;">/[^0-9]/</code> سيطابق <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-family: consolas; font-weight: bold; background: transparent none repeat scroll 0% 0%;">'B'</code> في <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-family: consolas; font-weight: bold; background: transparent none repeat scroll 0% 0%;">"B2 is the suite number."</code>.</p>
+
+ <p dir="rtl"> </p>
+ </td>
+ </tr>
+ <tr>
+ <td><code><strong><a href="https://developer.mozilla.org/ar/docs/Web/JavaScript/Guide/Regular_Expressions#special-form-feed" id="special-form-feed" name="special-form-feed">f\</a></strong></code></td>
+ <td>سيطابق نموذج التلقيم form feed (U+000C).</td>
+ </tr>
+ <tr>
+ <td><strong><code><a href="https://developer.mozilla.org/ar/docs/Web/JavaScript/Guide/Regular_Expressions#special-line-feed" id="special-line-feed" name="special-line-feed">n\</a></code></strong></td>
+ <td>سيطابق سطر التلقيم line feed (U+000A).</td>
+ </tr>
+ <tr>
+ <td><strong><code><a href="https://developer.mozilla.org/ar/docs/Web/JavaScript/Guide/Regular_Expressions#special-carriage-return" id="special-carriage-return" name="special-carriage-return">r\</a></code></strong></td>
+ <td>
+ <p>سيطابق carriage return (U+000D).</p>
+ </td>
+ </tr>
+ <tr>
+ <td><strong><code><a href="https://developer.mozilla.org/ar/docs/Web/JavaScript/Guide/Regular_Expressions#special-white-space" id="special-white-space" name="special-white-space">s\</a></code></strong></td>
+ <td>
+ <p> </p>
+
+ <p>مطابقة رمز المسافة الفارغة، بما في ذالك المسافة، التاب، نمودج التلقيم، سطر التلقيم، ويكافئ <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-weight: bold; font-family: consolas; background: transparent none repeat scroll 0% 0%;">[ \f\n\r\t\v\u00a0\u1680\u180e\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]</code>.</p>
+
+ <p>مثلا، <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-weight: bold; font-family: consolas; background: transparent none repeat scroll 0% 0%;">/\s\w*/</code> سيطابق <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-family: consolas; font-weight: bold; background: transparent none repeat scroll 0% 0%;">' bar'</code> في <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-family: consolas; font-weight: bold; background: transparent none repeat scroll 0% 0%;">"foo bar."</code></p>
+
+ <p> </p>
+ </td>
+ </tr>
+ <tr>
+ <td><strong><code><a href="https://developer.mozilla.org/ar/docs/Web/JavaScript/Guide/Regular_Expressions#special-non-white-space" id="special-non-white-space" name="special-non-white-space">S\</a></code></strong></td>
+ <td>
+ <p> </p>
+
+ <p>مطابقة اي شئ ما عدا رمز المسافة الفارغة، ويكافئ <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-weight: bold; font-family: consolas; background: transparent none repeat scroll 0% 0%;">[^ \f\n\r\t\v\u00a0\u1680\u180e\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]</code>.</p>
+
+ <p>مثلا، <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-weight: bold; font-family: consolas; background: transparent none repeat scroll 0% 0%;">/\S*/</code> سيطابق <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-family: consolas; font-weight: bold; background: transparent none repeat scroll 0% 0%;">'foo'</code> في <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-family: consolas; font-weight: bold; background: transparent none repeat scroll 0% 0%;">"foo bar."</code></p>
+
+ <p> </p>
+ </td>
+ </tr>
+ <tr>
+ <td><strong><code><a href="https://developer.mozilla.org/ar/docs/Web/JavaScript/Guide/Regular_Expressions#special-tab" id="special-tab" name="special-tab">t\</a></code></strong></td>
+ <td>سيطابق tab (U+0009).</td>
+ </tr>
+ <tr>
+ <td><strong><code><a href="https://developer.mozilla.org/ar/docs/Web/JavaScript/Guide/Regular_Expressions#special-vertical-tab" id="special-vertical-tab" name="special-vertical-tab">v\</a></code></strong></td>
+ <td>
+ <p>سيطابق vertical tab (U+000B).</p>
+ </td>
+ </tr>
+ <tr>
+ <td><strong><code><a href="https://developer.mozilla.org/ar/docs/Web/JavaScript/Guide/Regular_Expressions#special-word" id="special-word" name="special-word">w\</a></code></strong></td>
+ <td>
+ <p> </p>
+
+ <p>مطابقة الحروف الابجدية بما في ذالك ال underscore. ويكافي <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-weight: bold; font-family: consolas; background: transparent none repeat scroll 0% 0%;">[A-Za-z0-9_]</code>.</p>
+
+ <p>مثلا، <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-weight: bold; font-family: consolas; background: transparent none repeat scroll 0% 0%;">/\w/</code> سيطابق <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-family: consolas; font-weight: bold; background: transparent none repeat scroll 0% 0%;">'a'</code>في <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-family: consolas; font-weight: bold; background: transparent none repeat scroll 0% 0%;">"apple,"</code> و <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-family: consolas; font-weight: bold; background: transparent none repeat scroll 0% 0%;">'5'</code> في <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-family: consolas; font-weight: bold; background: transparent none repeat scroll 0% 0%;">"$5.28,"</code> و <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-family: consolas; font-weight: bold; background: transparent none repeat scroll 0% 0%;">'3'</code> في <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-family: consolas; font-weight: bold; background: transparent none repeat scroll 0% 0%;">"3D."</code></p>
+ </td>
+ </tr>
+ <tr>
+ <td><strong><code><a href="https://developer.mozilla.org/ar/docs/Web/JavaScript/Guide/Regular_Expressions#special-non-word" id="special-non-word" name="special-non-word">W\</a></code></strong></td>
+ <td>
+ <p> </p>
+
+ <p>مطابقة اي شئ غير الحروف الابجدية والاندرسكور، ويكافئ <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-weight: bold; font-family: consolas; background: transparent none repeat scroll 0% 0%;">[^A-Za-z0-9_]</code>.</p>
+
+ <p>مثلا، <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-weight: bold; font-family: consolas; background: transparent none repeat scroll 0% 0%;">/\W/</code> او <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-weight: bold; font-family: consolas; background: transparent none repeat scroll 0% 0%;">/[^A-Za-z0-9_]/</code> سيطابق <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-family: consolas; font-weight: bold; background: transparent none repeat scroll 0% 0%;">'%'</code> في <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-family: consolas; font-weight: bold; background: transparent none repeat scroll 0% 0%;">"50%."</code>.</p>
+
+ <p> </p>
+ </td>
+ </tr>
+ <tr>
+ <td><strong><code><a href="https://developer.mozilla.org/ar/docs/Web/JavaScript/Guide/Regular_Expressions#special-backreference" id="special-backreference" name="special-backreference">n\</a></code></strong></td>
+ <td>
+ <p> </p>
+
+ <p>حيث ان <em>n</em> عدد صحيح موجب، سيشير الى المجموعة المفهرسة <em>capturing parentheses</em> .</p>
+
+ <p>مثلا، <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-weight: bold; font-family: consolas; background: transparent none repeat scroll 0% 0%;">/apple(,)\sorange\1/</code> سيطابق <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-family: consolas; font-weight: bold; background: transparent none repeat scroll 0% 0%;">'apple, orange,'</code> في <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-family: consolas; font-weight: bold; background: transparent none repeat scroll 0% 0%;">"apple, orange, cherry, peach."</code>.</p>
+
+ <p> </p>
+ </td>
+ </tr>
+ <tr>
+ <td><strong><code><a href="https://developer.mozilla.org/ar/docs/Web/JavaScript/Guide/Regular_Expressions#special-null" id="special-null" name="special-null">0\</a></code></strong></td>
+ <td>
+ <p> </p>
+
+ <p>مطابقة الرمز NULL (U+0000). لا تتبع هذا برقم آخر، بسبب ان <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-weight: bold; font-family: consolas; background: transparent none repeat scroll 0% 0%;">\0&lt;digits&gt;</code> هو <a href="https://developer.mozilla.org/en-US/docs/JavaScript/Guide/Values,_variables,_and_literals#Unicode_escape_sequences" title="https://developer.mozilla.org/en-US/docs/JavaScript/Guide/Values,_variables,_and_literals#Unicode_escape_sequences">تسلسل التهريب الثماني</a> استخدم <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-weight: bold; font-family: consolas; background: transparent none repeat scroll 0% 0%;">\x00</code> بدلا منه.</p>
+
+ <p> </p>
+ </td>
+ </tr>
+ <tr>
+ <td><strong><code><a href="https://developer.mozilla.org/ar/docs/Web/JavaScript/Guide/Regular_Expressions#special-hex-escape" id="special-hex-escape" name="special-hex-escape">xhh\</a></code></strong></td>
+ <td>مطابقة الرمز مع الكود hh (two hexadecimal digits).</td>
+ </tr>
+ <tr>
+ <td><strong><code><a href="https://developer.mozilla.org/ar/docs/Web/JavaScript/Guide/Regular_Expressions#special-unicode-escape" id="special-unicode-escape" name="special-unicode-escape">uhhhh\</a></code></strong></td>
+ <td>مطابقة الرمز مع الكود hhhh (four hexadecimal digits).</td>
+ </tr>
+ <tr>
+ <td><a href="https://developer.mozilla.org/ar/docs/Web/JavaScript/Guide/Regular_Expressions#special-unicode-escape-es6" id="special-unicode-escape-es6" name="special-unicode-escape-es6"><strong><code>u{hhhh</code></strong><code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-weight: bold; font-family: consolas; background: transparent none repeat scroll 0% 0%;">}</code></a></td>
+ <td>( فقط عندما يستخدم u flag ) سيطابق الرمز مع ال Unicode بالقيمة hhhh (hexadecimal digits).</td>
+ </tr>
+ </tbody>
+</table>
+
+<p dir="rtl" style="font-family: tahoma;">  لتهريب تعابير الريجكس في المدخلات النصية، يمكنك<span id="result_box" lang="ar"><span>  استخدام دالة الاستبدال التالية:</span></span></p>
+
+<pre class="brush: js line-numbers language-js" dir="rtl" style="font-family: tahoma;"><code class="language-js"><span class="keyword token">function</span> <span class="function token">escapeRegExp</span><span class="punctuation token">(</span>string<span class="punctuation token">)</span> <span class="punctuation token">{</span>
+ <span class="keyword token">return</span> string<span class="punctuation token">.</span><span class="function token">replace</span><span class="punctuation token">(</span><span class="regex token">/[.*+?^${}()|[\]\\]/g</span><span class="punctuation token">,</span> <span class="string token">'\\$&amp;'</span><span class="punctuation token">)</span><span class="punctuation token">;</span> <span class="comment token">// $&amp; means the whole matched string</span>
+<span class="punctuation token">}</span></code></pre>
+
+<p dir="rtl" style="font-family: tahoma;">يستخدم البند <strong><code>g</code></strong> بعد الباترن، لاجراء بحث عام، ينظر في كل السلسلة النصية ويعود بكل المطابقات. تم شرحه بالتفصيل ادناه. <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions#Advanced_searching_with_flags">البحث المتقدم باستخدام البنود</a>.</p>
+
+<h3 class="highlight-spanned" dir="rtl" id="استخدام_الاقواس" style="font-family: tahoma;"><span class="highlight-span">استخدام الاقواس</span></h3>
+
+<p dir="rtl" style="font-family: tahoma;">الاقواس المحيطة باي جزء من الباترن، تجعل هذا الجزء قابل للتخزين والفهرسة. بمجرد ما يتم تخزينه وفهرسته، يصبح قابلا لاعادة الاستخدام من اطراف اخرى، كما تم شرحه في<a href="https://developer.mozilla.org/ar/docs/Web/JavaScript/Guide/Regular_Expressions#Using_parenthesized_substring_matches"> استخدام مطابقة الاقواس الجزئية</a>.</p>
+
+<p dir="rtl"><font face="tahoma">مثلا، الباترن </font><code dir="ltr" style="font-family: consolas; color: rgb(0, 0, 0); font-size: 17px; font-weight: bold; background: none 0% 0% repeat scroll transparent;">/Chapter (\d+)\.\d*/</code><font face="tahoma"> يطابق بدقة، الرموز </font><code dir="ltr" style="font-family: consolas; color: rgb(0, 0, 0); font-size: 17px; font-weight: bold; background: none 0% 0% repeat scroll transparent;">'Chapter '</code><font face="tahoma"> متبوعة بواحد او اكثر من الارقام (</font><code dir="ltr" style="font-family: consolas; color: rgb(0, 0, 0); font-size: 17px; font-weight: bold; background: none 0% 0% repeat scroll transparent;">\d</code><font face="tahoma"> تشير الى اي رقم و </font><code dir="ltr" style="font-family: consolas; color: rgb(0, 0, 0); font-size: 17px; font-weight: bold; background: none 0% 0% repeat scroll transparent;">+</code><font face="tahoma"> تشير الى واحد او اكثر من المرات، بالاضافة الى الاقواس المستخدمة خصيصا </font><font face="consolas, Liberation Mono, courier, monospace"><span style="background-color: rgba(220, 220, 220, 0.5);"><strong>لتخزين وفهرسة ما سينتج عنه</strong></span></font><font face="tahoma"> )، متبوعا بنقطة او فاصلة عشرية التي هي نفسها من الرموز الخاصة، يسبقها الباكسلاش </font><strong style="font-family: tahoma;">\</strong><font face="tahoma"> الذي بدوه يخبر الباترن بان يعاملها كنقطة عادية، متبوعا باي رقم يكرر صفر او اكثر من المرات (</font><code dir="ltr" style="font-family: consolas; color: rgb(0, 0, 0); font-size: 17px; font-weight: bold; background: none 0% 0% repeat scroll transparent;">\d</code><font face="tahoma"> تشير الى اي رقم والنجمة </font><code dir="ltr" style="font-family: consolas; color: rgb(0, 0, 0); font-size: 17px; font-weight: bold; background: none 0% 0% repeat scroll transparent;">*</code><font face="tahoma"> تشير الى صفر او اكثر من المرات).</font></p>
+
+<p dir="rtl" style="font-family: tahoma;">هذا الباترن سيطابق <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-family: consolas; font-weight: bold; background: transparent none repeat scroll 0% 0%;">"Chapter 4.3"</code> في <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-family: consolas; font-weight: bold; background: transparent none repeat scroll 0% 0%;">"Open Chapter 4.3, paragraph 6"</code>، وايضا سيقوم بتخزين وفهرسة الجزئية <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-family: consolas; font-weight: bold; background: transparent none repeat scroll 0% 0%;">'4'</code>. بينما الباترن لا يطابق شئ في <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-family: consolas; font-weight: bold; background: transparent none repeat scroll 0% 0%;">"Chapter 3 and 4"</code> بسبب ان السلسلة الحرفية لاتحتوي على النقطة بعد الرقم <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-family: consolas; font-weight: bold; background: transparent none repeat scroll 0% 0%;">'3'</code>.</p>
+
+<p dir="rtl" style="font-family: tahoma;">لمطابقة سلسلة فرعية من دون التسبب في فهرسة الجزء المتطابق (راجع non-capturing)، ضمن الاقواس ابدا الباترن ب <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-weight: bold; font-family: consolas; background: transparent none repeat scroll 0% 0%;">?:</code>. مثلا <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-weight: bold; font-family: consolas; background: transparent none repeat scroll 0% 0%;">(?:\d+)</code> ستطابق واحد او اكثر من الارقام من دون ان تفهرس الرموز المتطابقة.</p>
+
+<h2 id="العمل_مع_الريجكس" style="font-family: tahoma;">العمل مع الريجكس</h2>
+
+<p dir="rtl" style="font-family: tahoma;">تستخدم التعابير القياسية مع اثنين من الاوبجكت. الاوبجكت الاول هو <strong><code>RegExp</code></strong> ويحتوي على الوظيفتين <strong><code>test</code></strong> و <strong><code>exec</code></strong> والاوبجكت الثاني وهو <strong><code>String</code></strong> ويحتوي على الوظائف التالية: <strong><code>match</code></strong>، <strong><code>replace</code></strong>، <strong><code>search</code></strong>، و <code><strong>split</strong></code>.  تم شرح هذه الوظائف بالتفصيل في <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference" title="en-US/docs/JavaScript/Reference">JavaScript reference</a>.</p>
+
+<table class="standard-table" style="font-family: tahoma;">
+ <caption>
+ <p>الوظائف المملوكة للكائن RegExp</p>
+ </caption>
+ <thead>
+ <tr>
+ <th scope="col">الوظيفة</th>
+ <th scope="col">وصفها</th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr>
+ <td><a class="new" href="https://developer.mozilla.org/ar/docs/Web/JavaScript/Reference/Global_Objects/RegExp/exec" rel="nofollow" title="The documentation about this has not yet been written; please consider contributing!"><code>exec</code></a></td>
+ <td dir="rtl"> تقوم هذه الوظيفة بتنفيذ بحث لمطابقة سلسلة نصية. وتعود بمصفوفة تحتوي على نتيجة البحث، او تعود ب null في حالة عدم المطابقة.</td>
+ </tr>
+ <tr>
+ <td><a class="new" href="https://developer.mozilla.org/ar/docs/Web/JavaScript/Reference/Global_Objects/RegExp/test" rel="nofollow" title="The documentation about this has not yet been written; please consider contributing!"><code>test</code></a></td>
+ <td dir="rtl"> تقوم هذه الوظيفة بعمل فحص لمطابقة سلسلة نصية. وتعود اما ب true او false.</td>
+ </tr>
+ <tr>
+ <td><a class="new" href="https://developer.mozilla.org/ar/docs/Web/JavaScript/Reference/Global_Objects/String/match" rel="nofollow" title="The documentation about this has not yet been written; please consider contributing!"><code>match</code></a></td>
+ <td dir="rtl"> تقوم هذه الوظيفة بتنفيذ بحث لمطابقة سلسلة نصية. وتعود بمصفوفة تحتوي على نتيجة البحث، او تعود ب null في حالة عدم المطابقة. (نفس ما تقوم به الوظيفة exec).</td>
+ </tr>
+ <tr>
+ <td><a class="new" href="https://developer.mozilla.org/ar/docs/Web/JavaScript/Reference/Global_Objects/String/search" rel="nofollow" title="The documentation about this has not yet been written; please consider contributing!"><code>search</code></a></td>
+ <td dir="rtl"> تقوم هذه الوظيفة بعمل فحص لمطابقة سلسلة نصية. وتعود برقم المكان الذي يتواجد فيه ما تمت مطابقته. او ب -1 في حالة لم يتم العثور على المطلوب.</td>
+ </tr>
+ <tr>
+ <td><a class="new" href="https://developer.mozilla.org/ar/docs/Web/JavaScript/Reference/Global_Objects/String/replace" rel="nofollow" title="The documentation about this has not yet been written; please consider contributing!"><code>replace</code></a></td>
+ <td dir="rtl"> تقوم هذه الوظيفة بتنفيذ بحث لمطابقة سلسلة نصية. ويحل محل السلسلة الجزئية المتطابقة، السلسلة الجزئية البديلة.</td>
+ </tr>
+ <tr>
+ <td><a class="new" href="https://developer.mozilla.org/ar/docs/Web/JavaScript/Reference/Global_Objects/String/split" rel="nofollow" title="The documentation about this has not yet been written; please consider contributing!"><code>split</code></a></td>
+ <td dir="rtl"> هذه الوظيفة تستخدم الريجكس او سلسلة نصية ثابتة لتقسيم السلسلة الى مصفوفة من السلاسل الجزئية.</td>
+ </tr>
+ </tbody>
+</table>
+
+<p dir="rtl" style="font-family: tahoma;">عندما تريد معرفة ما اذا كان الباترن موجود في سلسلة نصية ام لا، استخدم اما الوظيفة <strong><code>test</code></strong> او الوظيفة <strong><code>search</code></strong> ، اما لمعرفة المزيد من المعلومات (ولكن أبطأ قليلا في التنفيذ)، استخدم اما الوظيفة <strong><code>exec</code></strong> او الوظيفة <strong><code>match</code></strong> اذا استخدمت <strong><code>exec</code></strong> او <strong><code>match</code></strong> ونجحت المطابقة، فان هاتان الوظيفتان ستعود بمصفوفة، وفي نفس الوقت ستقوم بتحديث خصائص الريجكس المرتبطة به وكذلك خصائص الريجكس <strong><code>RegExp</code></strong>. اذا فشلت المطابقة, ستعود الوظيفة <strong><code>exec</code></strong> ب <strong><code>null</code></strong> ( <span class="short_text" id="result_box" lang="ar"><span>التي تفرض</span></span> <span lang="ar"><span>:</span></span> <code><strong>false</strong></code>).</p>
+
+<p dir="rtl" style="font-family: tahoma;">في المثال التالي، السكريبت يستخدم الوظيفة <strong><code>exec</code></strong> للبحث عن مطابقة في السلسلة النصية:</p>
+
+<pre class="brush: js line-numbers language-js" dir="rtl" style="font-family: tahoma;"><code class="language-js"><span class="keyword token">var</span> myRe <span class="operator token">=</span> <span class="regex token">/d(b+)d/g</span><span class="punctuation token">;</span>
+<span class="keyword token">var</span> myArray <span class="operator token">=</span> myRe<span class="punctuation token">.</span><span class="function token">exec</span><span class="punctuation token">(</span><span class="string token">'cdbbdbsbz'</span><span class="punctuation token">)</span><span class="punctuation token">;</span></code></pre>
+
+<p dir="rtl" style="font-family: tahoma;">إذا كنت لا تحتاج إلى الوصول إلى خصائص الريجكس، هناك طريقة بديلة لإنشاء <code>myArray</code>، كالتلي:</p>
+
+<pre class="brush: js line-numbers language-js" dir="rtl" style="font-family: tahoma;"><code class="language-js"><span class="keyword token">var</span> myArray <span class="operator token">=</span> <span class="regex token">/d(b+)d/g</span><span class="punctuation token">.</span><span class="function token">exec</span><span class="punctuation token">(</span><span class="string token">'cdbbdbsbz'</span><span class="punctuation token">)</span><span class="punctuation token">;</span> <span class="comment token">// similar to "cdbbdbsbz".match(/d(b+)d/g); however,</span>
+ <span class="comment token">// the latter outputs Array [ "dbbd" ], while</span>
+ <span class="comment token">// /d(b+)d/g.exec('cdbbdbsbz') outputs Array [ "dbbd", "bb" ].</span>
+ <span class="comment token">// See below for further info (CTRL+F "The behavior associated with the".)</span></code></pre>
+
+<p dir="rtl" style="font-family: tahoma;">إذا كنت ترغب في بناء ريجكس من سلسلة نصية، هناك بديل آخر، كالتالي:</p>
+
+<pre class="brush: js line-numbers language-js" dir="rtl" style="font-family: tahoma;"><code class="language-js"><span class="keyword token">var</span> myRe <span class="operator token">=</span> <span class="keyword token">new</span> <span class="class-name token">RegExp</span><span class="punctuation token">(</span><span class="string token">'d(b+)d'</span><span class="punctuation token">,</span> <span class="string token">'g'</span><span class="punctuation token">)</span><span class="punctuation token">;</span>
+<span class="keyword token">var</span> myArray <span class="operator token">=</span> myRe<span class="punctuation token">.</span><span class="function token">exec</span><span class="punctuation token">(</span><span class="string token">'cdbbdbsbz'</span><span class="punctuation token">)</span><span class="punctuation token">;</span></code></pre>
+
+<p dir="rtl" style="font-family: tahoma;">مع هذا السكريبت، تنجح المطابقة، ويتم ارجاع مصفوفة وتحديث الخصائص معروض في الجدول التالي.</p>
+
+<table class="standard-table" id="jumbIt" style="font-family: tahoma;">
+ <caption>
+ <p>نتائج تنفيذ الريجكس</p>
+ </caption>
+ <thead>
+ <tr>
+ <th scope="col">الكائن</th>
+ <th scope="col">الخاصية او الفهرس</th>
+ <th scope="col">الوصف</th>
+ <th scope="col">في هذا المثال</th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr>
+ <td rowspan="4"><code>myArray</code></td>
+ <td> </td>
+ <td dir="rtl">السلسلة النصية التي جرى مطابقتها وجميع السلاسل النصية الجزئية المفهرسة.</td>
+ <td><code>['dbbd', 'bb', index: 1, input: 'cdbbdbsbz']</code></td>
+ </tr>
+ <tr>
+ <td><code>index</code></td>
+ <td>فهرس بداية المُطابَقة في السلسلة النصية، والفهرسة تبتدئ من 0.</td>
+ <td><code>1</code></td>
+ </tr>
+ <tr>
+ <td><code>input</code></td>
+ <td>السلسلة النصية الأصلية.</td>
+ <td><code>"cdbbdbsbz"</code></td>
+ </tr>
+ <tr>
+ <td><code>[0]</code></td>
+ <td>الرموز الاخيرة التي جرى مطابقتها</td>
+ <td><code>"dbbd"</code></td>
+ </tr>
+ <tr>
+ <td rowspan="2"><code>myRe</code></td>
+ <td><code>lastIndex</code></td>
+ <td dir="rtl">الفهرس الذي ستبدأ عنده عملية البحث عن المطابقة التالية. وإذا لم يتم ضبط البند "<code>g</code>" فستبقى قيمته مساويةً للصفر. للمزيد حول <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions#Advanced_searching_with_flags">البحث المتقدم باستخدام البنود</a>.</td>
+ <td><code>5</code></td>
+ </tr>
+ <tr>
+ <td><code>source</code></td>
+ <td dir="rtl">نص الباترن. تم تحديثه في الوقت الذي تم فيه إنشاء الريجكس، وليس وقت تنفيذه.</td>
+ <td><code>"d(b+)d"</code></td>
+ </tr>
+ </tbody>
+</table>
+
+<p dir="rtl" style="font-family: tahoma;">كما شاهدنا في المثال الثاني، تستطيع استخدام ريجكس منشا من خلال معد الاوبجكت <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-family: consolas; font-weight: bold; background: transparent none repeat scroll 0% 0%;">"object initializer"</code>، من دون اسناده الى متغير. اذا قمت بعمل ذالك، كل ما سيحدث هو ظهور ريجكس جديد. لهذا السبب، لا يمكن الوصول الى خصائص الريجكس. يوضح المثال التالي كيفية الوصول الى خصائص الكائن بالطريقة الصحيحة:</p>
+
+<pre class="brush: js line-numbers language-js" dir="rtl" style="font-family: tahoma;"><code class="language-js"><span class="keyword token">var</span> myRe <span class="operator token">=</span> <span class="regex token">/d(b+)d/g</span><span class="punctuation token">;</span>
+<span class="keyword token">var</span> myArray <span class="operator token">=</span> myRe<span class="punctuation token">.</span><span class="function token">exec</span><span class="punctuation token">(</span><span class="string token">'cdbbdbsbz'</span><span class="punctuation token">)</span><span class="punctuation token">;</span>
+console<span class="punctuation token">.</span><span class="function token">log</span><span class="punctuation token">(</span><span class="string token">'The value of lastIndex is '</span> <span class="operator token">+</span> myRe<span class="punctuation token">.</span>lastIndex<span class="punctuation token">)</span><span class="punctuation token">;</span>
+
+<span class="comment token">// "The value of lastIndex is 5"</span></code></pre>
+
+<p style="font-family: tahoma;">بينما يوضح المثال التالي كيفية الوصول الى خصائص الكائن بالطريقة الخاطئة:</p>
+
+<pre class="brush: js line-numbers language-js" dir="rtl" style="font-family: tahoma;"><code class="language-js"><span class="keyword token">var</span> myArray <span class="operator token">=</span> <span class="regex token">/d(b+)d/g</span><span class="punctuation token">.</span><span class="function token">exec</span><span class="punctuation token">(</span><span class="string token">'cdbbdbsbz'</span><span class="punctuation token">)</span><span class="punctuation token">;</span>
+console<span class="punctuation token">.</span><span class="function token">log</span><span class="punctuation token">(</span><span class="string token">'The value of lastIndex is '</span> <span class="operator token">+</span> <span class="regex token">/d(b+)d/g</span><span class="punctuation token">.</span>lastIndex<span class="punctuation token">)</span><span class="punctuation token">;</span>
+
+<span class="comment token">// "The value of lastIndex is 0"</span></code></pre>
+
+<p dir="rtl" style="font-family: tahoma;">حاصل الباترن <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-weight: bold; font-family: consolas; background: transparent none repeat scroll 0% 0%;">/d(b+)d/g</code> في كلتا التعليمات البرمجية، عبارة عن كائنان مختلفان، لذالك هما مختلفان في قيمة الخاصية <code>lastIndex</code> اذا كنت ترغب في الوصول الى خصائص الريجكس المنشا من طرف معد او مهيئ الاوبجكت، يلزمك اولا اسناده لمتغير.</p>
+
+<h3 class="highlight-spanned" id="Using_parenthesized_substring_matches_2" style="font-family: tahoma;"><span class="highlight-span"><a id="Using_parenthesized_substring_matches" name="Using_parenthesized_substring_matches">Using parenthesized substring matches</a></span></h3>
+
+<p dir="rtl" style="font-family: tahoma;">بمجرد تضمين جزء من الباترن داخل الاقواس الهلالية، سيصبح جزءا مفهرسا قابل لاعادة الاستخدام، مثلا،  الباترن <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-weight: bold; font-family: consolas; background: transparent none repeat scroll 0% 0%;">/a(b)c/</code> سيطابق <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-family: consolas; font-weight: bold; background: transparent none repeat scroll 0% 0%;">'abc'</code> في  <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-family: consolas; font-weight: bold; background: transparent none repeat scroll 0% 0%;">"abcd"</code> ويفهرس المطابقة الجزئية <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-weight: bold; font-family: consolas; background: transparent none repeat scroll 0% 0%;">(b)</code> برقم <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-weight: bold; font-family: consolas; background: transparent none repeat scroll 0% 0%;">1</code>، ناتج المطابقة الجزئية <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-weight: bold; font-family: consolas; background: transparent none repeat scroll 0% 0%;">(b)</code> هو السلسلة الحرفية الجزئية <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-family: consolas; font-weight: bold; background: transparent none repeat scroll 0% 0%;">'b'</code>. لاستدعاء هذا الجزء المفهرس خارج الباترن، استخدم عناصر المصفوفة <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-weight: bold; font-family: consolas; background: transparent none repeat scroll 0% 0%;">[1]...</code>. ولاعادة استخدامها داخل الباترن استخدم الفهرسة الرقمية <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-weight: bold; font-family: consolas; background: transparent none repeat scroll 0% 0%;">\1 ...</code>.<br>
+ - كيفية استدعائها خارج الباترن:</p>
+
+<pre class="brush: js line-numbers language-js" dir="rtl" style="font-family: tahoma;"><code class="language-js"><span class="keyword token">var</span> myRe <span class="operator token">=</span> <span class="regex token">/a(b)c/</span><span class="punctuation token">;</span>
+<span class="keyword token">var</span> myArray <span class="operator token">=</span> myRe<span class="punctuation token">.</span><span class="function token">exec</span><span class="punctuation token">(</span><span class="string token">'abcb'</span><span class="punctuation token">)</span><span class="punctuation token">;</span>
+console<span class="punctuation token">.</span><span class="function token">log</span><span class="punctuation token">(</span><span class="string token">'The result of submatch N1: '</span> <span class="operator token">+</span> myArray<span class="punctuation token">[</span><span class="number token">1</span><span class="punctuation token">]</span> <span class="punctuation token">)</span><span class="punctuation token">;</span>
+
+<span class="comment token">// log: The result of submatch N1: b</span></code></pre>
+
+<p dir="rtl" style="font-family: tahoma;">يمكنك استخدام عدد لا متناهي من هذه الاجزاء المفهرسة، تبتدئ الفهرسة من واحد، عائد المصفوفة سيتضمن جميع الاجزاء المفهرسة في الباترن.<br>
+ كيفية اعادة استخدامها داخل الباترن:</p>
+
+<pre class="brush: js line-numbers language-js" dir="rtl" style="font-family: tahoma;"><code class="language-js"><span class="keyword token">var</span> myRe <span class="operator token">=</span> <span class="regex token">/a(b)c\s\1/g</span><span class="punctuation token">;</span>
+<span class="keyword token">var</span> myArray <span class="operator token">=</span> myRe<span class="punctuation token">.</span><span class="function token">exec</span><span class="punctuation token">(</span><span class="string token">'abc b'</span><span class="punctuation token">)</span><span class="punctuation token">;</span>
+console<span class="punctuation token">.</span><span class="function token">log</span><span class="punctuation token">(</span><span class="string token">'The result of submatch N1: '</span> <span class="operator token">+</span> myArray<span class="punctuation token">[</span><span class="number token">1</span><span class="punctuation token">]</span> <span class="punctuation token">)</span><span class="punctuation token">;</span>
+
+<span class="comment token">// log: The result of submatch N1: b</span></code></pre>
+
+<p dir="rtl" style="font-family: tahoma;">يستخدم السكريبت التالي الوظيفة <a class="new" href="https://developer.mozilla.org/ar/docs/Web/JavaScript/Reference/Global_Objects/String/replace" rel="nofollow" title="The documentation about this has not yet been written; please consider contributing!"><code>()replace</code></a> لعكس الكلمتين John و Smith في السلسلة النصية <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-family: consolas; font-weight: bold; background: transparent none repeat scroll 0% 0%;">'John Smith'</code>. ويستخدم في نص الاستبدال، المتغيرات السحرية <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-family: consolas; font-weight: bold; background: transparent none repeat scroll 0% 0%;">$1</code> و <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-family: consolas; font-weight: bold; background: transparent none repeat scroll 0% 0%;">$2</code> لاستدعاء المطابقة الجزئية المفهرسة الاولى والثانية. مثال:</p>
+
+<pre class="brush: js line-numbers language-js" dir="rtl" style="font-family: tahoma;"><code class="language-js"><span class="keyword token">var</span> re <span class="operator token">=</span> <span class="regex token">/(\w+)\s(\w+)/</span><span class="punctuation token">;</span>
+<span class="keyword token">var</span> str <span class="operator token">=</span> <span class="string token">'John Smith'</span><span class="punctuation token">;</span>
+<span class="keyword token">var</span> newstr <span class="operator token">=</span> str<span class="punctuation token">.</span><span class="function token">replace</span><span class="punctuation token">(</span>re<span class="punctuation token">,</span> <span class="string token">'$2, $1'</span><span class="punctuation token">)</span><span class="punctuation token">;</span>
+console<span class="punctuation token">.</span><span class="function token">log</span><span class="punctuation token">(</span>newstr<span class="punctuation token">)</span><span class="punctuation token">;</span>
+
+<span class="comment token">// "Smith, John"</span></code></pre>
+
+<div class="note" style="font-family: tahoma;">
+<p dir="rtl">ملاحظة: يسمح باستخدام المتغيرات السحرية، 9 مرات فقط، في العملية الواحدة.</p>
+</div>
+
+<h3 class="highlight-spanned" dir="rtl" id="البحث_المتقدم_باستخدام_البنود" style="font-family: tahoma;"><span class="highlight-span"><a name="Advanced_searching_with_flags">البحث المتقدم باستخدام البنود</a></span></h3>
+
+<p dir="rtl" style="font-family: tahoma;">التعبيرات القياسية في الجافاسكريبت لها خمسة بنود ، وجودها اختياريا، تسمح لنا بعمل بحثا عاما او بحثا دون مراعات لحالة الاحرف. يمكن استخدامها اما منفردة او مجتمعة وكذالك في اي ترتيب، حسب الطلب، وهي جزء من الريجكس.</p>
+
+<table class="standard-table" style="font-family: tahoma;">
+ <caption>
+ <p>بنود الريجكس</p>
+ </caption>
+ <thead>
+ <tr>
+ <th scope="col">Flag</th>
+ <th scope="col">Description</th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr>
+ <td><strong><code>g</code></strong></td>
+ <td dir="rtl">بحث عام، عدم وجوده = النتيجة الاولى فقط.</td>
+ </tr>
+ <tr>
+ <td><strong><code>i</code></strong></td>
+ <td dir="rtl">عدم مراعاة حالة الاحرف، سواء كانت صغيرة او كبيرة.</td>
+ </tr>
+ <tr>
+ <td><strong><code>m</code></strong></td>
+ <td dir="rtl">البحث في السطور المتعدد = كامل النص.</td>
+ </tr>
+ <tr>
+ <td><strong><code>u</code></strong></td>
+ <td dir="rtl">سلسلة يونيكود، أي معاملة الباترن على أنه سلسلة من رموز يونيكود (Unicode code points).</td>
+ </tr>
+ <tr>
+ <td><strong><code>y</code></strong></td>
+ <td dir="rtl">المطابقة ستبدأ من الفهرس المُشار إليه بالخاصية <code>lastIndex</code> لكائن التعابير النمطية في السلسلة الهدف، ولن تتم محاولة مطابقة ما قبل هذا الفهرس. للمزيد من المعلومات <a class="new" href="https://developer.mozilla.org/ar/docs/Web/JavaScript/Reference/Global_Objects/RegExp/sticky" rel="nofollow" title="The documentation about this has not yet been written; please consider contributing!"><code>sticky</code></a></td>
+ </tr>
+ </tbody>
+</table>
+
+<p dir="rtl" style="font-family: tahoma;">لتضمين بند مع الريجكس استخدم التعبير التالي:</p>
+
+<pre class="brush: js line-numbers language-js" dir="rtl" style="font-family: tahoma;"><code class="language-js"><span class="keyword token">var</span> re <span class="operator token">=</span> <span class="operator token">/</span>pattern<span class="operator token">/</span>flags<span class="punctuation token">;</span></code></pre>
+
+<p dir="rtl" style="font-family: tahoma;">او</p>
+
+<pre class="brush: js line-numbers language-js" dir="rtl" style="font-family: tahoma;"><code class="language-js"><span class="keyword token">var</span> re <span class="operator token">=</span> <span class="keyword token">new</span> <span class="class-name token">RegExp</span><span class="punctuation token">(</span><span class="string token">'pattern'</span><span class="punctuation token">,</span> <span class="string token">'flags'</span><span class="punctuation token">)</span><span class="punctuation token">;</span></code></pre>
+
+<p dir="rtl" style="font-family: tahoma;"><span id="result_box" lang="ar"><span>البنود، جزء لا يتجزأ من الريجكس.</span> <span>لا يمكن إزالتها أو إضافتها لاحقا.</span></span></p>
+
+<p dir="rtl" style="font-family: tahoma;">مثلا، <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-weight: bold; font-family: consolas; background: transparent none repeat scroll 0% 0%;">re = /\w+\s/g</code> يقوم بانشاء ريجكس يبحث على واحد او اكثر من الرموز متبوعة بمسافة واحدة، يقوم بتنفيذ هذا الاجراء على السلسلة الحرفية (كاملة = <code>g</code>):</p>
+
+<pre class="brush: js line-numbers language-js" dir="rtl" style="font-family: tahoma;"><code class="language-js"><span class="keyword token">var</span> re <span class="operator token">=</span> <span class="regex token">/\w+\s/g</span><span class="punctuation token">;</span>
+<span class="keyword token">var</span> str <span class="operator token">=</span> <span class="string token">'fee fi fo fum'</span><span class="punctuation token">;</span>
+<span class="keyword token">var</span> myArray <span class="operator token">=</span> str<span class="punctuation token">.</span><span class="function token">match</span><span class="punctuation token">(</span>re<span class="punctuation token">)</span><span class="punctuation token">;</span>
+console<span class="punctuation token">.</span><span class="function token">log</span><span class="punctuation token">(</span>myArray<span class="punctuation token">)</span><span class="punctuation token">;</span>
+
+<span class="comment token">// ["fee ", "fi ", "fo "]</span></code></pre>
+
+<p dir="rtl" style="font-family: tahoma;">يمكنك استبدال هذا السطر:</p>
+
+<pre class="brush: js line-numbers language-js" dir="rtl" style="font-family: tahoma;"><code class="language-js"><span class="keyword token">var</span> re <span class="operator token">=</span> <span class="regex token">/\w+\s/g</span><span class="punctuation token">;</span></code></pre>
+
+<p dir="rtl" style="font-family: tahoma;">ب:</p>
+
+<pre class="brush: js line-numbers language-js" dir="rtl" style="font-family: tahoma;"><code class="language-js"><span class="keyword token">var</span> re <span class="operator token">=</span> <span class="keyword token">new</span> <span class="class-name token">RegExp</span><span class="punctuation token">(</span><span class="string token">'\\w+\\s'</span><span class="punctuation token">,</span> <span class="string token">'g'</span><span class="punctuation token">)</span><span class="punctuation token">;</span></code></pre>
+
+<p dir="rtl" style="font-family: tahoma;">وستحصل على نفس النتيجة.</p>
+
+<p dir="rtl" style="font-family: tahoma;">يستخدم  البند <strong><code>m</code></strong> لاخبار محرك الريجكس، بان المدخلات النصية، المتعددة السطور، يجب ان تعامل كسطور متعددة. اذا تم استخدام البند <strong><code>m</code></strong> فسيتطابق الرمزان الخاصان <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-weight: bold; font-family: consolas; background: transparent none repeat scroll 0% 0%;">^</code> و <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-weight: bold; font-family: consolas; background: transparent none repeat scroll 0% 0%;">$</code> ، <span id="result_box" lang="ar"><span>مع بداية أو نهاية كل سطر من المدخلات،</span></span> بدلا من المدخل بالكامل. مثال:</p>
+
+<pre class="brush: js line-numbers language-js" dir="rtl" style="font-family: tahoma;"><code class="language-js"><span class="keyword token">var</span> re <span class="operator token">=</span> <span class="regex token">/^Multi\s*line$/gm</span><span class="punctuation token">;</span>
+<span class="keyword token">var</span> str <span class="operator token">=</span> <span class="string token">'Multi line\n or \nMultiline'</span><span class="punctuation token">;</span>
+<span class="keyword token">var</span> myArray <span class="operator token">=</span> str<span class="punctuation token">.</span><span class="function token">match</span><span class="punctuation token">(</span> re <span class="punctuation token">)</span><span class="punctuation token">;</span>
+
+console<span class="punctuation token">.</span><span class="function token">log</span><span class="punctuation token">(</span> myArray <span class="punctuation token">)</span><span class="punctuation token">;</span>
+<span class="comment token">// log: [ "Multi line", "Multiline" ]</span></code></pre>
+
+<p dir="rtl" style="font-family: tahoma;"> </p>
+
+<h2 id="امثلة" style="font-family: tahoma;">امثلة</h2>
+
+<p style="font-family: tahoma;">تبين الامثلة التالية بعض استخدامات الريجكس</p>
+
+<h3 class="highlight-spanned" dir="rtl" id="اعادة_صياغة_المدخلات_النصية." style="font-family: tahoma;"><span class="highlight-span">اعادة صياغة المدخلات النصية.</span></h3>
+
+<p dir="rtl" style="font-family: tahoma;">يوضح المثال التالي كيف يمكن للريجكس ان يتلاعب في بنية السلسلة النصية، وايضا كيفية استخدام <strong><code>()string.split</code></strong> و <strong><code>()string.replace</code></strong>. سيقوم السكريبت التالي بتنظيف واعادة صياغة السلسلة النصية، التي تحتوي على اسماء مفصولة بمسافات فارغة، تابات، وبالظبط فاصلة منقوطة واحدة. واخيرا سيقوم بعكس هذه الاسماء وترتيبها من a الى z.</p>
+
+<pre class="brush: js line-numbers language-js" dir="rtl" style="font-family: tahoma;"><code class="language-js"><span class="comment token">// The name string contains multiple spaces and tabs,</span>
+<span class="comment token">// and may have multiple spaces between first and last names.</span>
+<span class="keyword token">var</span> names <span class="operator token">=</span> <span class="string token">'Orange Trump ;Fred Barney; Helen Rigby ; Bill Abel ; Chris Hand '</span><span class="punctuation token">;</span>
+
+<span class="keyword token">var</span> output <span class="operator token">=</span> <span class="punctuation token">[</span><span class="string token">'---------- Original String\n'</span><span class="punctuation token">,</span> names <span class="operator token">+</span> <span class="string token">'\n'</span><span class="punctuation token">]</span><span class="punctuation token">;</span>
+
+<span class="comment token">// Prepare two regular expression patterns and array storage.</span>
+<span class="comment token">// Split the string into array elements.</span>
+
+<span class="comment token">// pattern: possible white space then semicolon then possible white space</span>
+<span class="keyword token">var</span> pattern <span class="operator token">=</span> <span class="regex token">/\s*;\s*/</span><span class="punctuation token">;</span>
+
+<span class="comment token">// Break the string into pieces separated by the pattern above and</span>
+<span class="comment token">// store the pieces in an array called nameList</span>
+<span class="keyword token">var</span> nameList <span class="operator token">=</span> names<span class="punctuation token">.</span><span class="function token">split</span><span class="punctuation token">(</span>pattern<span class="punctuation token">)</span><span class="punctuation token">;</span>
+
+<span class="comment token">// new pattern: one or more characters then spaces then characters.</span>
+<span class="comment token">// Use parentheses to "memorize" portions of the pattern.</span>
+<span class="comment token">// The memorized portions are referred to later.</span>
+pattern <span class="operator token">=</span> <span class="regex token">/(\w+)\s+(\w+)/</span><span class="punctuation token">;</span>
+
+<span class="comment token">// Below is the new array for holding names being processed.</span>
+<span class="keyword token">var</span> bySurnameList <span class="operator token">=</span> <span class="punctuation token">[</span><span class="punctuation token">]</span><span class="punctuation token">;</span>
+
+<span class="comment token">// Display the name array and populate the new array</span>
+<span class="comment token">// with comma-separated names, last first.</span>
+<span class="comment token">//</span>
+<span class="comment token">// The replace method removes anything matching the pattern</span>
+<span class="comment token">// and replaces it with the memorized string—the second memorized portion</span>
+<span class="comment token">// followed by a comma, a space and the first memorized portion.</span>
+<span class="comment token">//</span>
+<span class="comment token">// The variables $1 and $2 refer to the portions</span>
+<span class="comment token">// memorized while matching the pattern.</span>
+
+output<span class="punctuation token">.</span><span class="function token">push</span><span class="punctuation token">(</span><span class="string token">'---------- After Split by Regular Expression'</span><span class="punctuation token">)</span><span class="punctuation token">;</span>
+
+<span class="keyword token">var</span> i<span class="punctuation token">,</span> len<span class="punctuation token">;</span>
+<span class="keyword token">for</span> <span class="punctuation token">(</span>i <span class="operator token">=</span> <span class="number token">0</span><span class="punctuation token">,</span> len <span class="operator token">=</span> nameList<span class="punctuation token">.</span>length<span class="punctuation token">;</span> i <span class="operator token">&lt;</span> len<span class="punctuation token">;</span> i<span class="operator token">++</span><span class="punctuation token">)</span> <span class="punctuation token">{</span>
+ output<span class="punctuation token">.</span><span class="function token">push</span><span class="punctuation token">(</span>nameList<span class="punctuation token">[</span>i<span class="punctuation token">]</span><span class="punctuation token">)</span><span class="punctuation token">;</span>
+ bySurnameList<span class="punctuation token">[</span>i<span class="punctuation token">]</span> <span class="operator token">=</span> nameList<span class="punctuation token">[</span>i<span class="punctuation token">]</span><span class="punctuation token">.</span><span class="function token">replace</span><span class="punctuation token">(</span>pattern<span class="punctuation token">,</span> <span class="string token">'$2, $1'</span><span class="punctuation token">)</span><span class="punctuation token">;</span>
+<span class="punctuation token">}</span>
+
+<span class="comment token">// Display the new array.</span>
+output<span class="punctuation token">.</span><span class="function token">push</span><span class="punctuation token">(</span><span class="string token">'---------- Names Reversed'</span><span class="punctuation token">)</span><span class="punctuation token">;</span>
+<span class="keyword token">for</span> <span class="punctuation token">(</span>i <span class="operator token">=</span> <span class="number token">0</span><span class="punctuation token">,</span> len <span class="operator token">=</span> bySurnameList<span class="punctuation token">.</span>length<span class="punctuation token">;</span> i <span class="operator token">&lt;</span> len<span class="punctuation token">;</span> i<span class="operator token">++</span><span class="punctuation token">)</span> <span class="punctuation token">{</span>
+ output<span class="punctuation token">.</span><span class="function token">push</span><span class="punctuation token">(</span>bySurnameList<span class="punctuation token">[</span>i<span class="punctuation token">]</span><span class="punctuation token">)</span><span class="punctuation token">;</span>
+<span class="punctuation token">}</span>
+
+<span class="comment token">// Sort by last name, then display the sorted array.</span>
+bySurnameList<span class="punctuation token">.</span><span class="function token">sort</span><span class="punctuation token">(</span><span class="punctuation token">)</span><span class="punctuation token">;</span>
+output<span class="punctuation token">.</span><span class="function token">push</span><span class="punctuation token">(</span><span class="string token">'---------- Sorted'</span><span class="punctuation token">)</span><span class="punctuation token">;</span>
+<span class="keyword token">for</span> <span class="punctuation token">(</span>i <span class="operator token">=</span> <span class="number token">0</span><span class="punctuation token">,</span> len <span class="operator token">=</span> bySurnameList<span class="punctuation token">.</span>length<span class="punctuation token">;</span> i <span class="operator token">&lt;</span> len<span class="punctuation token">;</span> i<span class="operator token">++</span><span class="punctuation token">)</span> <span class="punctuation token">{</span>
+ output<span class="punctuation token">.</span><span class="function token">push</span><span class="punctuation token">(</span>bySurnameList<span class="punctuation token">[</span>i<span class="punctuation token">]</span><span class="punctuation token">)</span><span class="punctuation token">;</span>
+<span class="punctuation token">}</span>
+
+output<span class="punctuation token">.</span><span class="function token">push</span><span class="punctuation token">(</span><span class="string token">'---------- End'</span><span class="punctuation token">)</span><span class="punctuation token">;</span>
+
+console<span class="punctuation token">.</span><span class="function token">log</span><span class="punctuation token">(</span>output<span class="punctuation token">.</span><span class="function token">join</span><span class="punctuation token">(</span><span class="string token">'\n'</span><span class="punctuation token">)</span><span class="punctuation token">)</span><span class="punctuation token">;</span></code></pre>
+
+<h3 class="highlight-spanned" id="استخدام_الرموز_الخاصة_للتحقق_من_صحة_المدخلات." style="font-family: tahoma;"><span class="highlight-span">استخدام الرموز الخاصة للتحقق من صحة المدخلات.</span></h3>
+
+<p dir="rtl" style="font-family: tahoma;">في المثال التالي، يتوقع من المستخدم ادخال رقم الهاتف. عندما سينقر المستخدم على زر "الفحص" سيقوم السكريبت بفحص صحة الرقم. اذا كان الرقم صحيحا، سيقوم السكريبت باظهار رسالة تشكر المستخدم وتظهر الرقم المدخل. اذا كان الرقم غير صحيح، سيقوم السكريبت باخبار المستخدم بان الرقم المدخل غير صحيح.</p>
+
+<p dir="rtl" style="font-family: tahoma;">بعد <em>non-capturing parentheses</em> <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-weight: bold; font-family: consolas; background: transparent none repeat scroll 0% 0%;">(?:</code> سينظر الريجكس الى الثلاثة ارقام <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-weight: bold; font-family: consolas; background: transparent none repeat scroll 0% 0%;">\d{3}</code> او <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-weight: bold; font-family: consolas; background: transparent none repeat scroll 0% 0%;">|</code> الى القوس اليساري <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-weight: bold; font-family: consolas; background: transparent none repeat scroll 0% 0%;">\(</code> متبوعا بثلاثة ارقام<code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-weight: bold; font-family: consolas; background: transparent none repeat scroll 0% 0%;"> \d{3}</code> متبوعة بقوس الاغلاق <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-weight: bold; font-family: consolas; background: transparent none repeat scroll 0% 0%;">\)</code>, (نهاية <em>non-capturing parenthesis</em> <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-weight: bold; font-family: consolas; background: transparent none repeat scroll 0% 0%;">)</code>)، متبوعة بشرطة واحدة تليها الباكسلاش او النقطة الكسرية، اذا وجدت قم بفهرستها <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-weight: bold; font-family: consolas; background: transparent none repeat scroll 0% 0%;">([-\/\.])</code>، متبوعة بثلاث ارقام <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-weight: bold; font-family: consolas; background: transparent none repeat scroll 0% 0%;">\d{3}</code>، متبوعة باستدعاء الجزء المفهرس <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-weight: bold; font-family: consolas; background: transparent none repeat scroll 0% 0%;">\1</code>, متبوعا باربعة ارقام <code dir="ltr" style="color: rgb(0, 0, 0); font-size: 17px; font-weight: bold; font-family: consolas; background: transparent none repeat scroll 0% 0%;">\d{4}</code>.</p>
+
+<p dir="rtl" style="font-family: tahoma;"><span id="result_box" lang="ar"><span>يتم تنشيط حدث التغيير عندما يقوم المستخدم بالضغط على إنتر وملأ القيمة </span></span><code>RegExp.input</code><span lang="ar"><span>.</span></span></p>
+
+<pre class="brush: html line-numbers language-html" dir="rtl" style="font-family: tahoma;"><code class="language-html"><span class="doctype token">&lt;!DOCTYPE html&gt;</span>
+<span class="tag token"><span class="tag token"><span class="punctuation token">&lt;</span>html</span><span class="punctuation token">&gt;</span></span>
+ <span class="tag token"><span class="tag token"><span class="punctuation token">&lt;</span>head</span><span class="punctuation token">&gt;</span></span>
+ <span class="tag token"><span class="tag token"><span class="punctuation token">&lt;</span>meta</span> <span class="attr-name token">http-equiv</span><span class="attr-value token"><span class="punctuation token">=</span><span class="punctuation token">"</span>Content-Type<span class="punctuation token">"</span></span> <span class="attr-name token">content</span><span class="attr-value token"><span class="punctuation token">=</span><span class="punctuation token">"</span>text/html; charset<span class="punctuation token">=</span>ISO-8859-1<span class="punctuation token">"</span></span><span class="punctuation token">&gt;</span></span>
+ <span class="tag token"><span class="tag token"><span class="punctuation token">&lt;</span>meta</span> <span class="attr-name token">http-equiv</span><span class="attr-value token"><span class="punctuation token">=</span><span class="punctuation token">"</span>Content-Script-Type<span class="punctuation token">"</span></span> <span class="attr-name token">content</span><span class="attr-value token"><span class="punctuation token">=</span><span class="punctuation token">"</span>text/javascript<span class="punctuation token">"</span></span><span class="punctuation token">&gt;</span></span>
+ <span class="tag token"><span class="tag token"><span class="punctuation token">&lt;</span>script</span> <span class="attr-name token">type</span><span class="attr-value token"><span class="punctuation token">=</span><span class="punctuation token">"</span>text/javascript<span class="punctuation token">"</span></span><span class="punctuation token">&gt;</span></span><span class="language-javascript script token">
+ <span class="keyword token">var</span> re <span class="operator token">=</span> <span class="regex token">/(?:\d{3}|\(\d{3}\))([-\/\.])\d{3}\1\d{4}/</span><span class="punctuation token">;</span>
+ <span class="keyword token">function</span> <span class="function token">testInfo</span><span class="punctuation token">(</span>phoneInput<span class="punctuation token">)</span> <span class="punctuation token">{</span>
+ <span class="keyword token">var</span> OK <span class="operator token">=</span> re<span class="punctuation token">.</span><span class="function token">exec</span><span class="punctuation token">(</span>phoneInput<span class="punctuation token">.</span>value<span class="punctuation token">)</span><span class="punctuation token">;</span>
+ <span class="keyword token">if</span> <span class="punctuation token">(</span><span class="operator token">!</span>OK<span class="punctuation token">)</span>
+ window<span class="punctuation token">.</span><span class="function token">alert</span><span class="punctuation token">(</span>phoneInput<span class="punctuation token">.</span>value <span class="operator token">+</span> <span class="string token">' isn\'t a phone number with area code!'</span><span class="punctuation token">)</span><span class="punctuation token">;</span>
+ <span class="keyword token">else</span>
+ window<span class="punctuation token">.</span><span class="function token">alert</span><span class="punctuation token">(</span><span class="string token">'Thanks, your phone number is '</span> <span class="operator token">+</span> OK<span class="punctuation token">[</span><span class="number token">0</span><span class="punctuation token">]</span><span class="punctuation token">)</span><span class="punctuation token">;</span>
+ <span class="punctuation token">}</span>
+ </span><span class="tag token"><span class="tag token"><span class="punctuation token">&lt;/</span>script</span><span class="punctuation token">&gt;</span></span>
+ <span class="tag token"><span class="tag token"><span class="punctuation token">&lt;/</span>head</span><span class="punctuation token">&gt;</span></span>
+ <span class="tag token"><span class="tag token"><span class="punctuation token">&lt;</span>body</span><span class="punctuation token">&gt;</span></span>
+ <span class="tag token"><span class="tag token"><span class="punctuation token">&lt;</span>p</span><span class="punctuation token">&gt;</span></span>Enter your phone number (with area code) and then click "Check".
+ <span class="tag token"><span class="tag token"><span class="punctuation token">&lt;</span>br</span><span class="punctuation token">&gt;</span></span>The expected format is like ###-###-####.<span class="tag token"><span class="tag token"><span class="punctuation token">&lt;/</span>p</span><span class="punctuation token">&gt;</span></span>
+ <span class="tag token"><span class="tag token"><span class="punctuation token">&lt;</span>form</span> <span class="attr-name token">action</span><span class="attr-value token"><span class="punctuation token">=</span><span class="punctuation token">"</span>#<span class="punctuation token">"</span></span><span class="punctuation token">&gt;</span></span>
+ <span class="tag token"><span class="tag token"><span class="punctuation token">&lt;</span>input</span> <span class="attr-name token">id</span><span class="attr-value token"><span class="punctuation token">=</span><span class="punctuation token">"</span>phone<span class="punctuation token">"</span></span><span class="punctuation token">&gt;</span></span><span class="tag token"><span class="tag token"><span class="punctuation token">&lt;</span>button</span> <span class="attr-name token">onclick</span><span class="attr-value token"><span class="punctuation token">=</span><span class="punctuation token">"</span>testInfo(document.getElementById(<span class="punctuation token">'</span>phone<span class="punctuation token">'</span>));<span class="punctuation token">"</span></span><span class="punctuation token">&gt;</span></span>Check<span class="tag token"><span class="tag token"><span class="punctuation token">&lt;/</span>button</span><span class="punctuation token">&gt;</span></span>
+ <span class="tag token"><span class="tag token"><span class="punctuation token">&lt;/</span>form</span><span class="punctuation token">&gt;</span></span>
+ <span class="tag token"><span class="tag token"><span class="punctuation token">&lt;/</span>body</span><span class="punctuation token">&gt;</span></span>
+<span class="tag token"><span class="tag token"><span class="punctuation token">&lt;/</span>html</span><span class="punctuation token">&gt;</span></span></code></pre>
+</div>
+
+<p>{{PreviousNext("Web/JavaScript/Guide/Text_formatting", "Web/JavaScript/Guide/Indexed_collections")}}</p>