الفرق بين المراجعتين ل"Kotlin/kotlin.text/Regex"

من موسوعة حسوب
اذهب إلى التنقل اذهب إلى البحث
سطر 1: سطر 1:
 
<noinclude>{{DISPLAYTITLE:الصنف <code>‎‎Regex</code>‎ في Kotlin}}</noinclude>
 
<noinclude>{{DISPLAYTITLE:الصنف <code>‎‎Regex</code>‎ في Kotlin}}</noinclude>
تمثل نتيجة مطابقة واحدة [[Kotlin/kotlin.text/Regex/index|لتعبير نمطي]].
+
يمثل  [[Kotlin/kotlin.text/Regex/index|تعبيرًا نمطيا]] قابلا للتعديل (immutable regular expression).
 +
 
 +
== الدوال البانية ==
  
 
=== <code>[[Kotlin/kotlin.text/Regex/Init|<init>]]</code> ===
 
=== <code>[[Kotlin/kotlin.text/Regex/Init|<init>]]</code> ===
 +
 +
== الخاصيات ==
 +
 
=== <code>[[Kotlin/kotlin.text/Regex/options|options]]</code> ===
 
=== <code>[[Kotlin/kotlin.text/Regex/options|options]]</code> ===
 
=== <code>[[Kotlin/kotlin.text/Regex/pattern|pattern]]</code> ===
 
=== <code>[[Kotlin/kotlin.text/Regex/pattern|pattern]]</code> ===
 +
 +
== الدوال ==
 +
 
=== <code>[[Kotlin/kotlin.text/Regex/containsMatchIn|containsMatchIn]]</code> ===
 
=== <code>[[Kotlin/kotlin.text/Regex/containsMatchIn|containsMatchIn]]</code> ===
 
=== <code>[[Kotlin/kotlin.text/Regex/find|find]]</code> ===
 
=== <code>[[Kotlin/kotlin.text/Regex/find|find]]</code> ===
سطر 15: سطر 23:
 
=== <code>[[Kotlin/kotlin.text/Regex/toPattern|toPattern]]</code> ===
 
=== <code>[[Kotlin/kotlin.text/Regex/toPattern|toPattern]]</code> ===
 
=== <code>[[Kotlin/kotlin.text/Regex/toString|toString]]</code> ===
 
=== <code>[[Kotlin/kotlin.text/Regex/toString|toString]]</code> ===
 
 
 
== الأنواع ==
 
 
===<code>[[Kotlin/kotlin.text/MatchResult/Destructured/index|Destructured]]</code>===
 
يوفر مركبات التعيين التفكيكي (destructuring assignment) لمجموعة من القيم.
 
 
== الخاصيات ==
 
 
===<code>[[Kotlin/kotlin.text/MatchResult/destructured|destructured‎]]</code>===
 
الخاصية <code>destructured‎</code> تعيد نسخة من الصنف <code>[[Kotlin/kotlin.text/MatchResult/Destructured/index|MatchResult.Destructured]]،</code> والتي توفّر مركبات لتفكيك قيم المجموعة المُطابقة. المركبة الأولى تقابل قيمة المجموعة المُطابقَة الأولى، والمركبة الثانية تقابل الثانية، وهكذا دواليك.
 
 
===<code>[[Kotlin/kotlin.text/MatchResult/groupValues|groupValues]]</code>===
 
تعيد الخاصية <code>groupValues</code> لائحة تضم مجموعة المُطابقات  <nowiki/>[[Kotlin/kotlin.text/Regex/index|للتعبير النمطي]]. حجم تلك اللائحة يساوي <code>groupCount + 1،</code> حيث<code>groupCount</code>هو عدد المجموعات المطابَقة في  <nowiki/>[[Kotlin/kotlin.text/Regex/index|التعبير النمطي]]. تلك المجموعات مُفهرسة من 1 حتى <code>groupCount،</code> والمجموعة ذات الفهرس <code>0</code> توافق المطابقة الكلية.
 
 
===<code>[[Kotlin/kotlin.text/MatchResult/groups|groups]]</code>===
 
تعيد الخاصية <code>groups</code> كائنًا من النوع <code>[[Kotlin/kotlin.text/MatchGroupCollection/index|MatchGroupCollection]]</code> يضم مجموعة المُطابقات الموجودة في <nowiki/>[[Kotlin/kotlin.text/Regex/index|التعبير النمطي]]. حجم تلك المجموعة يساوي<code>groupCount + 1،</code> حيث<code>groupCount</code> هو عدد المجموعات المطابَقة في  <nowiki/>[[Kotlin/kotlin.text/Regex/index|التعبير النمطي]]. تلك المجموعات مُفهرسة من 1 حتى <code>groupCount،</code>والمجموعة ذات الفهرس <code>0</code> توافق المطابقة الكلية.
 
 
===<code>[[Kotlin/kotlin.text/MatchResult/range|range]]</code>===
 
تعيد الخاصية <code>range</code> مجال الفهارس الذي يحدد مكان مُطابقة <nowiki/>[[Kotlin/kotlin.text/Regex/index|التعبير النمطي]].
 
 
===<code>[[Kotlin/kotlin.text/MatchResult/value|value]]</code>===
 
تعيد الخاصية <code>value</code> جزء من السلسلة النصية المُدخلة والمُطابقة <nowiki/>[[Kotlin/kotlin.text/Regex/index|للتعبير النمطي]].
 
 
== الدوال ==
 
 
===<code>[[Kotlin/kotlin.text/MatchResult/next|next]]</code>===
 
تعيد الدالة<code>next()‎</code> كائنًا من النوع <code>[[Kotlin/kotlin.text/MatchResult/index|MatchResult]]</code> يحتوي نتائج المطابقة الموالية <nowiki/>[[Kotlin/kotlin.text/Regex/index|للتعبير النمطي]]، بداية من فهرس آخر مطابقة.
 
  
 
== الدوال الموروثة (Inherited Functions) ==
 
== الدوال الموروثة (Inherited Functions) ==
سطر 52: سطر 31:
 
=== <code>[[Kotlin/Any/hashCode|hashCode]]</code> ===
 
=== <code>[[Kotlin/Any/hashCode|hashCode]]</code> ===
 
يعيد التابع <code>hashCode()</code>‎ قيمة الشيفرة hash code الخاصّة بالكائن الذي استُدعي عبره.
 
يعيد التابع <code>hashCode()</code>‎ قيمة الشيفرة hash code الخاصّة بالكائن الذي استُدعي عبره.
 
=== <code>[[Kotlin/Any/toString|toString]]</code> ===
 
يعيد التابع <code>toString()‎</code> تمثيلًا نصيًا للكائن الذي يُستدعى عبره.
 
 
[[تصنيف:Kotlin]]
 
[[تصنيف:Kotlin]]
 
[[تصنيف:Kotlin Classes]]
 
[[تصنيف:Kotlin Classes]]
 
[[تصنيف:Kotlin Regex]]
 
[[تصنيف:Kotlin Regex]]

مراجعة 16:39، 19 يوليو 2018

يمثل تعبيرًا نمطيا قابلا للتعديل (immutable regular expression).

الدوال البانية

<init>

الخاصيات

options

pattern

الدوال

containsMatchIn

find

findAll

matchEntire

matches

replace

replaceFirst

split

toPattern

toString

الدوال الموروثة (Inherited Functions)

equals

تبين الدالة equals()‎ إذا ما كان الكائن المُمرّر إليها يساوي الكائن الذي استدعيت عبره.

hashCode

يعيد التابع hashCode()‎ قيمة الشيفرة hash code الخاصّة بالكائن الذي استُدعي عبره.