Regular Expression to mask any string matching 10 digits only in golang
问题 Since golang regex does not support lookaheads, I was wondering is there any way i can create a regex that will mask any string having a 10 digit number. func main() { s := "arandomsensitive information: 1234567890 this is not senstive: 1234567890000000" re := regexp.MustCompile(`\d{10}`) s = re.ReplaceAllString(s, "$1**********$2") fmt.Println(s) } Is it possible to get an output like this "arandomsensitive information: 1234****** this is not senstive: 1234567890000000" Also any regex