---
id: regex-ok
name: Regex.ok
category: regex
kind: namespace-method
tokens: Regex.ok
sig: Regex.ok(match) -> bool
tip: True if the match succeeded (the Match is non-null).
order: 13
ns: Regex
member: ok
---
Returns whether match is a real match rather than null — the readable way to test the result of Regex.find / Regex.exec / Regex.next, and the loop condition for a find-all.
Parameters:
- `match` — a `Match` value (possibly null)
```ludic
program Demo {
entry {
if not Regex.ok(Regex.find("abc", "\\d")) { print(1) }
}
}
```