cls_rgw_client
cls_user_client
cls_lock_client
- Boost::regex
${BLKID_LIBRARIES}
${CURL_LIBRARIES}
${EXPAT_LIBRARIES}
cls_rgw_client
cls_user_client
cls_lock_client
- Boost::regex
${BLKID_LIBRARIES}
${CURL_LIBRARIES}
${EXPAT_LIBRARIES}
#include "common/safe_io.h"
#include "global/global_context.h"
#include <iostream>
-#include <boost/regex.hpp>
+#include <regex>
#include <boost/algorithm/string.hpp>
#include <boost/lexical_cast.hpp>
spec_validation = SPEC_VALIDATION_NONE;
}
- boost::regex pattern;
+ std::regex pattern;
switch (spec_validation) {
case SPEC_VALIDATION_FULL:
// disallow "/" and "@" in image and snap name
break;
}
- boost::smatch match;
- if (!boost::regex_match(spec, match, pattern)) {
+ std::smatch match;
+ if (!std::regex_match(spec, match, pattern)) {
std::cerr << "rbd: invalid spec '" << spec << "'" << std::endl;
return -EINVAL;
}
int extract_group_spec(const std::string &spec,
std::string *pool_name,
std::string *group_name) {
- boost::regex pattern;
+ std::regex pattern;
pattern = "^(?:([^/]+)/)?(.+)?$";
- boost::smatch match;
- if (!boost::regex_match(spec, match, pattern)) {
+ std::smatch match;
+ if (!std::regex_match(spec, match, pattern)) {
std::cerr << "rbd: invalid spec '" << spec << "'" << std::endl;
return -EINVAL;
}
int extract_image_id_spec(const std::string &spec, std::string *pool_name,
std::string *image_id) {
- boost::regex pattern;
+ std::regex pattern;
pattern = "^(?:([^/]+)/)?(.+)?$";
- boost::smatch match;
- if (!boost::regex_match(spec, match, pattern)) {
+ std::smatch match;
+ if (!std::regex_match(spec, match, pattern)) {
std::cerr << "rbd: invalid spec '" << spec << "'" << std::endl;
return -EINVAL;
}
//Validate pool name while creating/renaming/copying/cloning/importing/etc
if (spec_validation == SPEC_VALIDATION_FULL) {
- boost::regex pattern("^[^@/]+?$");
- if ((pool_name != nullptr) && !boost::regex_match (*pool_name, pattern)) {
+ std::regex pattern("^[^@/]+?$");
+ if ((pool_name != nullptr) && !std::regex_match (*pool_name, pattern)) {
std::cerr << "rbd: invalid pool name '" << *pool_name << "'" << std::endl;
return -EINVAL;
}
if (spec_validation == SPEC_VALIDATION_SNAP) {
// disallow "/" and "@" in snap name
- boost::regex pattern("^[^@/]*?$");
- if (!boost::regex_match (snap_name, pattern)) {
+ std::regex pattern("^[^@/]*?$");
+ if (!std::regex_match (snap_name, pattern)) {
std::cerr << "rbd: invalid snap name '" << snap_name << "'" << std::endl;
return -EINVAL;
}
#include "global/global_context.h"
#include <iostream>
#include <boost/program_options.hpp>
-#include <boost/regex.hpp>
namespace rbd {
namespace action {
#include "global/global_context.h"
#include <functional>
#include <iostream>
+#include <regex>
#include <boost/program_options.hpp>
-#include <boost/regex.hpp>
#include "include/assert.h"
#include <atomic>
}
int validate_uuid(const std::string &uuid) {
- boost::regex pattern("^[A-F0-9]{8}-[A-F0-9]{4}-[A-F0-9]{4}-[A-F0-9]{4}-[A-F0-9]{12}$",
- boost::regex::icase);
- boost::smatch match;
- if (!boost::regex_match(uuid, match, pattern)) {
+ std::regex pattern("^[A-F0-9]{8}-[A-F0-9]{4}-[A-F0-9]{4}-[A-F0-9]{4}-[A-F0-9]{12}$",
+ std::regex::icase);
+ std::smatch match;
+ if (!std::regex_match(uuid, match, pattern)) {
std::cerr << "rbd: invalid uuid '" << uuid << "'" << std::endl;
return -EINVAL;
}
}
if (!spec.empty()) {
- boost::regex pattern("^(?:(client\\.[^@]+)@)?([^/@]+)$");
- boost::smatch match;
- if (!boost::regex_match(spec, match, pattern)) {
+ std::regex pattern("^(?:(client\\.[^@]+)@)?([^/@]+)$");
+ std::smatch match;
+ if (!std::regex_match(spec, match, pattern)) {
std::cerr << "rbd: invalid spec '" << spec << "'" << std::endl;
return -EINVAL;
}
#include <iostream>
#include <memory>
#include <boost/algorithm/string/predicate.hpp>
-#include <boost/regex.hpp>
+#include <regex>
#include "common/Formatter.h"
#include "common/Preforker.h"
static int parse_imgpath(const std::string &imgpath, std::string *poolname,
std::string *imgname, std::string *snapname) {
- boost::regex pattern("^(?:([^/@]+)/)?([^/@]+)(?:@([^/@]+))?$");
- boost::smatch match;
- if (!boost::regex_match(imgpath, match, pattern)) {
+{
+ std::regex pattern("^(?:([^/@]+)/)?([^/@]+)(?:@([^/@]+))?$");
+ std::smatch match;
+ if (!std::regex_match(imgpath, match, pattern)) {
std::cerr << "rbd-ggate: invalid spec '" << imgpath << "'" << std::endl;
return -EINVAL;
}
#include <fstream>
#include <iostream>
#include <memory>
-#include <boost/regex.hpp>
+#include <regex>
#include <boost/algorithm/string/predicate.hpp>
#include "common/Formatter.h"
static int parse_imgpath(const std::string &imgpath, Config *cfg,
std::ostream *err_msg) {
- boost::regex pattern("^(?:([^/@]+)/)?([^/@]+)(?:@([^/@]+))?$");
- boost::smatch match;
- if (!boost::regex_match(imgpath, match, pattern)) {
- *err_msg << "rbd-nbd: invalid spec '" << imgpath << "'";
+ std::regex pattern("^(?:([^/@]+)/)?([^/@]+)(?:@([^/@]+))?$");
+ std::smatch match;
+ if (!std::regex_match(imgpath, match, pattern)) {
+ std::cerr << "rbd-nbd: invalid spec '" << imgpath << "'" << std::endl;
return -EINVAL;
}