bobzhang/pygments/regex does not have a README file
pub suberror RegexError {
Syntax(pattern~ : String, pos~ : Int, message~ : String)
BudgetExceeded(pattern~ : String)
} derive(Debug)pub struct Budget {
remaining : Int
}pub struct Match {
text : String
// private fields
}pub struct Regex {
pattern : String
flags : Int
// private fields
}fn Regex::fullmatch(self : Regex, text : String, pos? : Int, endpos? : Int, budget? : Budget) -> Match? raise RegexErrorfn Regex::match_at(self : Regex, text : String, pos : Int, endpos? : Int, budget? : Budget) -> Match? raise RegexErrorfn Regex::replace_all(self : Regex, text : String, f : (Match) -> String, budget? : Budget) -> String raise RegexErrorfn Regex::search(self : Regex, text : String, pos? : Int, endpos? : Int, budget? : Budget) -> Match? raise RegexErrortest {
let re = @regex.compile("(?P<word>\\w+)\\s*=", flags=@regex.MULTILINE)
guard re.match_at(" key = 1", 2) is Some(m) else { fail("no match") }
debug_inspect(m.group(1), content="Some(\"key\")")
inspect(m.end(), content="7")
}let default_steps : IntInstall
Download zipA port of Pygments (generic syntax highlighter) to MoonBit
Dependencies