I have this ugly sentences separated with ||.
const a = "they *have* a* car* sold. ||They* eat* the * good * stuff";
How can I split the given string by * or || signs so that we get this result:
['they', 'have','a', 'car', 'sold', 'they', 'eat', 'the ', 'good ', 'stuff'];
I don't mind spacing issues I want the split by this or that functionality.
Note: we can achieve this simply using a map but I wonder if there is a solution by regex or something!