727
738
// capturing parentheses named with the (?P<name>...) syntax. A
728
739
// reference to an out of range or unmatched index or a name that is not
729
740
// present in the regular expression is replaced with an empty slice.
731
742
// In the $name form, name is taken to be as long as possible: $1x is
732
743
// equivalent to ${1x}, not ${1}x, and, $10 is equivalent to ${10}, not ${1}0.
734
745
// To insert a literal $ in the output, use $$ in the template.
735
746
func (re *Regexp) Expand(dst []byte, template []byte, src []byte, match []int) []byte {
736
747
return re.expand(dst, string(template), src, "", match)