method
Regex.exec
Regex.exec(text, re) -> Match
The compiled-pattern form of Regex.find: returns the first Match of the pre-compiled re in text, or null.
Parameters
textthe string to searchrea compiled RegexExample
program Demo {
entry {
let re = Regex.compile("#(\\w+)")
let m = Regex.exec("a #tag b", re)
print(Regex.group(m, 1))
}
}