Hi everyone, I need to split text which contains random text with the dash ‘-’ character surrounded by whitespaces and also dash without whitespaces. I need to split it around the dash which is not surrounded by whitespace. I assume this can be done with a regex, but I can’t figure out the pattern.
Sample text: “this is a - sample test to demonstrate-what i wrote - above”
Desired split output: “this is a - sample test to demonstrate”, “what i wrote - above”
Any help is appreciated.