method
Regex.test
Regex.test(text, re) -> bool
The compiled-pattern form of Regex.matches: returns whether the pre-compiled re matches anywhere in text. No per-call parsing, so this is the one to call every frame.
Parameters
textthe string to searchrea compiled Regex from Regex.compileExample
program Demo {
entry {
let re = Regex.compile("[a-z]+")
if Regex.test("hello", re) { print(1) }
}
}