First let me say, I have gone thoroughly through all other solutions to this problem on SO, and although they are very similar, none fully solve my problem.
I need a to extract all tokens excluding quotes (for the quoted ones) using boost regex.
The regex I think I need to use is:
sregex pattern = sregex::compile("\"(?P<token>[^\"]*)\"|(?P<token>\\S+)");
But I get an error of:
named mark already exists
The solution posted for C# seems to work with a duplicate named mark given that it is an OR expression with the other one.
I answered a very similar question here:
How to make my split work only on one real line and be capable to skip quoted parts of string?
The example code
Tested with a relatively wide range of compiler versions and Boost versions.