package main
import (
"fmt"
"regexp"
)
func main() {
s := "aaa : bbb / ccc . ddd ? eee&fff - ggg_hhh | iii \n jjj"
// Define the delimiters (comma, space, exclamation mark, question mark)
delimiters := regexp.MustCompile(`[,\s!?\-_|/\n.:&]+`) // Corrected regex
// Split the string using the defined delimiters
words := delimiters.Split(s, -1)
for _, value := range words {
fmt.Printf("%s\n", value)
}
}
/*
run:
aaa
bbb
ccc
ddd
eee
fff
ggg
hhh
iii
jjj
*/