#Gleam replace with a capturing group?
1 messages · Page 1 of 1 (latest)
1 messages · Page 1 of 1 (latest)
Its currently not replacing \1 with the actual captured group even though the implementation in the erlang re supports perl style regex replacement. Any help?
let assert Ok(arithmetic) = regex.from_string("(\\*|\\/|%|-|\\+|<|>)")
let reply =
regex.replace(
each: arithmetic,
in: reply,
with: highlight_ansi("\\1", FgBlue),
)
here's my current code
i basically want to get an operator and highlight it in blue
nvm i was stupid