Open scpeters-test opened 6 years ago
Original report (archived issue) by Sean Curtis (Bitbucket: SeanCurtisTRI).
In the sdf::trim function, it is trimming off leading and trailing space and tab characters. I'd recommend going further in capturing all characters that C++ considers to be whitespace. Something like:
sdf::trim
std::string trim(const std::string& name) { std::regex trim_regex("^\\s*(.*?)\\s*$"); std::smatch matches; std::regex_match(name, matches, trim_regex); return matches[1].str(); }
Also, we might want to consider what whitespace is allowed inside strings. It would be silly to have a name: "a\f\vb".
"a\f\vb"
Original report (archived issue) by Sean Curtis (Bitbucket: SeanCurtisTRI).
In the
sdf::trim
function, it is trimming off leading and trailing space and tab characters. I'd recommend going further in capturing all characters that C++ considers to be whitespace. Something like:Also, we might want to consider what whitespace is allowed inside strings. It would be silly to have a name:
"a\f\vb"
.