#include <iostream>
#include <regex>
using namespace std;
string mask = " 01 02 03 ?? ?? 0? 2? 88 ";
cout << mask << "|" << endl;
mask = regex_replace(mask, regex("^\s+"), "");
mask = regex_replace(mask, regex("\s+$"), "");
cout << mask << "|" << endl;
01 02 03 ?? ?? 0? 2? 88 |
01 02 03 ?? ?? 0? 2? 88|