How can I get all content between pipes and return a space where it comes across two pipes next to each other?
An example string and desired output is:
|test1| test2|test3 || test 4 |
Result1: "test1"
Result2: "test2"
Result3: "test3"
Result4: " "
Result5: "test4"
The closest I’ve got so far is:
/[^\|]+)/which will get all data between pipes but does not detect||./\|([^\|]*)/which will get all data between pipes and detect||but have an extra whitespace result at the end.
In Ruby I’d not bother with a regex: