tpl: Add limit support to replaceRE
authorCameron Moore <moorereason@gmail.com>
Fri, 28 Aug 2020 14:29:26 +0000 (09:29 -0500)
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Fri, 28 Aug 2020 16:57:56 +0000 (18:57 +0200)
commitcdfd1c99baa22d69e865294dfcd783811f96c880
tree0e2e21537de208baf493318c0e38b2b1631f7c8f
parent047af7cfe5e9aa740b85e0f9974a2d31a0ef4c08
tpl: Add limit support to replaceRE

Go stdlib doesn't contain a limited replace in the regexp package, but
we can accomplish the same thing with ReplaceAllStringFunc.

Fixes #7586
tpl/strings/init.go
tpl/strings/regexp.go
tpl/strings/regexp_test.go