I am considering input files with lines like
\"20170103\",\"MW JANE DOE\",\"NL01 INGB 1234 5678 90\",\"NL02 INGB 1234 5678 90\",\"GT\",\"Af\",\"12,34\",\"Interne
You have a pattern with a capturing group. So, when your regex finds a match, the double quotes are part of the whole match value (that is stored in the [0]
th element), but the captured part is stored in the [1]
th element.
So, you just need to access capturing group #1 contents:
linePart=it->str(1);
See regular-expressions.info Finding a Regex Match:
When the function call returns true, you can call the
str()
,position()
, andlength()
member functions of the match_results object to get the text that was matched, or the starting position and its length of the match relative to the subject string. Call these member functions without a parameter or with 0 as the parameter to get the overall regex match. Call them passing 1 or greater to get the match of a particular capturing group. Thesize()
member function indicates the number of capturing groups plus one for the overall match. Thus you can pass a value up tosize()-1
to the other three member functions.