Split string using regular expression in Go


I’m trying to find a good way to split a string using a regular expression instead of a string. Thanks



If you just want to split on certain characters, you can use strings.FieldsFunc, otherwise I’d go with regexp.FindAllString.

Answered By – Anschel Schaffer-Cohen

Answer Checked By – Robin (GoLangFix Admin)

Leave a Reply

Your email address will not be published.