Example:
abc | efg || $something("arg 1", "arg 2||(a|b)") || 123
or without whitespace
abc|efg||$something("arg 1", "arg 2||(a|b)")||123
What RegEx pattern is needed so that I can get the following groups:
abc | efg
$something("arg 1", "arg 2||(a|b)")
123
Total of 3 groups.
Another example:
"abc || efg" || 123
Should give me 2 groups
"abc || efg"
123
Basically it cuts or splits the string by double pipes but excluding double pipes within double quotes.
My failed attempts are the following:
.+?(?=\|\|)|.*
\".+?\"|.+?(?=\|\|)|.*