text := "123-456-7890" re := regexp.MustCompile(`\d`) result := re.ReplaceAllString(text, "X") fmt.Println(result) // خروجی: "XXX-XXX-XXXX"