method
Regex.find
Regex.find(text, pattern) -> Match
Searches text and returns the first Match — carrying the overall span and every capture group — or null if the pattern does not match. Read groups with Regex.group and spans with Regex.start / Regex.end.
Parameters
textthe string to searchpatternthe regular expression sourceExample
program Demo {
entry {
let m = Regex.find("name: Alice", "(\\w+): (\\w+)")
if Regex.ok(m) { print(1) }
}
}