API Reference › Regex › Regex.ok
method

Regex.ok

Regex.ok(match) -> bool

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

matcha Match value (possibly null)

Example

program Demo {
  entry {
    if not Regex.ok(Regex.find("abc", "\\d")) { print(1) }
  }
}
← All symbols