# RegEx

## 🧱 Temel Kullanım

* 👨‍🔬 Regex test işlemleri için [Regex101](https://regex101.com/) sitesini kullanabilirsiniz
* 💠 Tüm regex metotlarına [`Regex`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.text/-regex/index.html) ile erişebilirsiniz
* ⚙️ Kotlin Regex ayarlarına [`RegexOption`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.text/-regex-option/index.html) ile erişebilirsiniz

{% hint style="info" %}
‍🧙‍♂ Detaylı bilgi için [Kotlin Regex](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.text/-regex/index.html) alanına bakabilirsin.
{% endhint %}

## ⭐ Basit Kullanım

```kotlin
// . ile tüm karakterler alınır
"""<pre>.*</pre>""".toRegex(RegexOption.DOT_MATCHES_ALL)
regex.find(response)?.value?.let { // İlk bulunanı döndürür
    // Bulunan metin `it`
}
```

## 🍱 Gruplama

```kotlin
val text = "Hello Alice. Hello Bob. Hello Eve."
val regex = Regex("Hello (.*?)[.]")
val matches = regex.findAll(text)
val names = matches.map { it.groupValues[1] }.joinToString()
println(names) // Alice, Bob, Eve
```

## 🔗 Faydalı Bağlantılar

{% embed url="<https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.text/-regex/index.html>" %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.yemreak.com/arsiv/kotlin/regex.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
