I want to split a string to a slice but want to keep the delimiters. Is there a way to do that in golang?
"Hello! It's, a? beautiful$ day* (today and tomorrow).
[Hello | ! | It's | , | a | ? | beautiful | $ | day | * | ( | today | and | tomorrow | ) | . ]
| represents the separation of elements.
Can anyone help?