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