func ReverseSentence(s string, delims []string) string {

	delimRegex := "[" + strings.Join(delims, "") + "]"

	re := regexp.MustCompile(`(.*?` + delimRegex + `)\s*`)
	matches := re.FindAllStringSubmatch(s, -1)
	var sentences = []string{}

	for _, match := range matches {
		sentences = append(sentences, match[1]) // match[1] is the submatch
	}

	reversed := reverseStrSlice(sentences)

	return strings.Join(reversed, " ")
}
// ReverseSentence reverses words based on zero or more delimeters, e.g. {" ", "."}
// This is a solution for a previous version of the course material
ReverseSentence reverses words based on zero or more delimeters, e.g. {" ", "."}
This is a solution for a previous version of the course material
// ReverseSentence reverses words based on zero or more delimeters e . g . { " " " . " } // This is a solution for a previous version of the course material
func ReverseSentence(s string, delims []string) string {
	delimRegex := "[" + strings.Join(delims, "") + "]"
	re := regexp.MustCompile(`(.*?` + delimRegex + `)\s*`)
	matches := re.FindAllStringSubmatch(s, -1)
	var sentences = []string{}
	for _, match := range matches {
		sentences = append(sentences, match[1]) 
	}
	reversed := reverseStrSlice(sentences)
	return strings.Join(reversed, " ")
}
func ReverseSentence ( s string , delims [ ] string ) string { delimRegex := " " + strings . Join ( delims , " " ) + " " re := regexp . MustCompile ( `(.*?` + delimRegex + `)\s*` ) matches := re . FindAllStringSubmatch ( s , - 1 ) var sentences = [ ] string { } for _ , match := range matches { sentences = append ( sentences , match [ 1 ] ) } reversed := reverseStrSlice ( sentences ) return strings . Join ( reversed , " " ) }
ReverseSentence reverses words based on zero or more delimeters, e.g.
ReverseSentence reverses words based on zero or more delimeters e . g .
// match[1] is the submatch