## Regex In Swift

### Пример

Все отрицательные числа

```swift
let input = "0 12 -5 123 -18 -7"
// regex pattern
let regex = /-\d+/
let res = input.matches(of: regex)
for i in res.indices {
    print(res[i].output)
}
```

---

[1.3.4.2 Greedy And Lazy Search Theme](./1.3.4.2%20GreedyAndLazySearch.md) | [Back To iTWiki Contents](https://github.com/eldaroid/iTWiki) |  [2 ComputerScience Theme Folder](/2%20ComputerScience/)
