الفرق بين المراجعتين ل"Kotlin/kotlin.text/Regex/options"
< Kotlin | kotlin.text | Regex
اذهب إلى التنقل
اذهب إلى البحث
(أنشأ الصفحة ب'<noinclude>{{DISPLAYTITLE: صفحة <code>options</code> في لغة Kotlin}}</noinclude> تعيد الدالة<code>options</code> الحرف المقابل لل...') |
|||
سطر 1: | سطر 1: | ||
− | <noinclude>{{DISPLAYTITLE: | + | <noinclude>{{DISPLAYTITLE: الخاصية <code>Regex.options</code> في لغة Kotlin}}</noinclude> |
− | + | تعبر الخاصية <code>options</code> عن مجموعة الخيارات التي استُخدمت في إنشاء التعبير النمطي الذي استُدعيت عبره<nowiki/><nowiki/>. | |
==البنية العامة== | ==البنية العامة== | ||
<syntaxhighlight lang="kotlin"> | <syntaxhighlight lang="kotlin"> | ||
− | + | actual val options: Set<RegexOption> | |
</syntaxhighlight> | </syntaxhighlight> | ||
==القيمة المُعادة== | ==القيمة المُعادة== | ||
− | + | [[Kotlin/Set|مجموعة]]. | |
==أمثلة== | ==أمثلة== | ||
− | ===استخدام | + | ===استخدام الخاصية <code>options</code>=== |
− | + | ينشِئ التابع <code>Regex()</code> في الشيفرة الآتية تعبيرًا نمطيًا باسم <code>reg</code> ، ثم يستدعي الخاصية <code>options</code> عبره:<syntaxhighlight lang="kotlin"> | |
− | fun main(args: Array<String>) { | + | fun main(args: Array<String>) { |
− | + | val reg = Regex("""-?\d+(\.\d+)?""", RegexOption.UNIX_LINES) | |
− | |||
− | |||
− | + | print(reg.options) // [UNIX_LINES] | |
− | |||
− | |||
} | } | ||
</syntaxhighlight> | </syntaxhighlight> | ||
==أنظر أيضًا== | ==أنظر أيضًا== | ||
− | * <code>[[Kotlin/ | + | * صفحة <code>[[Kotlin/kotlin.text/Regex/index|Regex]]</code>. |
− | |||
− | |||
− | |||
==مصادر== | ==مصادر== | ||
− | * [ | + | * [http://kotlinlang.org/api/latest/jvm/stdlib/kotlin.text/-regex/options.html صفحة الخاصية Regex.options في التوثيق الرسميّ للمكتبة القياسيّة في لغة Kotlin.] |
[[تصنيف:Kotlin]] | [[تصنيف:Kotlin]] | ||
+ | [[تصنيف: Kotlin Proprety]] |
مراجعة 19:04، 4 يوليو 2018
تعبر الخاصية options
عن مجموعة الخيارات التي استُخدمت في إنشاء التعبير النمطي الذي استُدعيت عبره.
البنية العامة
actual val options: Set<RegexOption>
القيمة المُعادة
أمثلة
استخدام الخاصية options
ينشِئ التابع Regex()
في الشيفرة الآتية تعبيرًا نمطيًا باسم reg
، ثم يستدعي الخاصية options
عبره:
fun main(args: Array<String>) {
val reg = Regex("""-?\d+(\.\d+)?""", RegexOption.UNIX_LINES)
print(reg.options) // [UNIX_LINES]
}
أنظر أيضًا
- صفحة
Regex
.