I want to parse the target string "Soup base vegetarian no msg "
to be an array of ["Soup", "base", "vegetarian", "no msg"]
so basically parse by space except when space follows the word "no"
I tried below and the result wasn't exactly right:
let test = "Soup base vegetarian no msg ";
console.log(test.split(/([^no]\s)/g));
what regex should I use to achieve such?