You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: transform_character_scramble.go
    path of file: ./repos/neosync/worker/internal/benthos/transformers
    
    the code of the file until where you have to start completion: package transformers

import (
	"fmt"
	"regexp"
	"strings"
	"unicode"

	"github.com/benthosdev/benthos/v4/public/bloblang"
	transformer_utils "github.com/nucleuscloud/neosync/worker/internal/benthos/transformers/utils"
)

const (
	letterList      = "abcdefghijklmnopqrstuvwxyz"
	numberList      = "0123456789"
	specialCharList = "!@#$%^&*()-+=_ []{}|\\;\"<>,./?"
)

func init() {
	spec := bloblang.NewPluginSpec().
		Param(bloblang.NewAnyParam("value").Optional()).Param(bloblang.NewStringParam("user_provided_regex").Optional())

	err := bloblang.RegisterFunctionV2("transform_character_scramble", spec, func(args *bloblang.ParsedParams) (bloblang.Function, error) {
		valuePtr, err := args.GetOptionalString("value")
		if err != nil {
			return nil, err
		}

		var value string
		if valuePtr != nil {
			value = *valuePtr
		}

		regexPtr
    
func TransformCharacterScramble(value, regex string) (*string, error) {
	if value == "" {
		return nil, nil
	}

	if regex != "" {
		reg, err := regexp.Compile(regex)
		if err != nil {
			return nil, err
		}

		// finds all matches in a string
		matches := reg.FindAllStringIndex(value, -1)
		transformedString := value

		// if no matches are found just scramble the entire string
		if matches == nil {
			transformedString := strings.Map(ScrambleChar, value)
			return &transformedString, nil
		}

		// match is a [][]int with the inner []int being the start and end index values of the match
		for _, match := range matches {
			start, end := match[0], match[1]
			// run the scrambler for the substring
			matchTransformed := strings.Map(ScrambleChar, value[start:end])
			// replace the original substring with its transformed version
			transformedString = transformedString[:start] + matchTransformed + transformedString[end:]
		}

		return &transformedString, nil
	} else {
		transformedString := strings.Map(ScrambleChar, value)
		return &transformedString, nil
	}
}