Suppose I have a string
Max and Bob and Merry and {Jack and Co.} and Lisa.
I need to split it with and being the delimiter, but only if it does not occur within curly braces.
So from the above string I should get 5 strings:
Max, Bob, Merry, Jack and Co., Lisa.
I tried something like this pattern:
[^\\\{.+]\\band\\b[^.+\\\}]
But it doesn't work - Jack and Co. are still split as well (I use C++ so I have to escape special characters twice).