Open jyapayne opened 4 years ago
It'd be nice, but in the meantime do this:
import regex
import strutils
proc reTitleCase(m: RegexMatch, s: string): string =
result.add(s[m.group(0)[0]].toUpperAscii)
result.add(s[m.group(1)[0]])
doAssert "STUFFabc".replace(re"STUFF([a-z])([a-z]+)", reTitleCase) == "Abc"
I would like to be able to perform an uppercase transform on a regex replacement. For example:
Basically, I want something like described here