const boost::regex& regexEmbeddedUnit() {
  std::stringstream regexComposer;
  regexComposer << "(?:(?:^| )" << regexUnit().str() << "(?:$| |\\.$|\\. |,|;)|"
                       << "\\(" << regexUnit().str() << "\\)|" 
                       << "\\{" << regexUnit().str() << "\\}|"
                       << "\\[" << regexUnit().str() << "\\])";
  static boost::regex rgx(regexComposer.str());
  return rgx;
}
const boost::regex& regexQuantity() {
  std::stringstream regexComposer;
  regexComposer << "(" << regexFixedPrecisionValue().str() << "|"
    << regexScientificNotationValue().str() << ")( |/)" << regexUnit().str();
  static boost::regex rgx(regexComposer.str());
  return rgx;
}
bool isUnit(const std::string& s) {
  std::string tmp = regexUnit().str();
  return boost::regex_match(s,regexUnit());
}
Beispiel #4
0
bool isUnit(const std::string& s) {
  return boost::regex_match(s,regexUnit());
}