6bool isIdentifier(
const std::string& token) {
10 std::regex identifierPattern(
"[\\w\\.:]+");
11 return std::regex_match(token, identifierPattern);
14bool isIdentifier(
const std::string* token) {
15 if (!token || token->empty()) {
18 return isIdentifier(*token);
21SelectorTokenizer::SelectorTokenizer(
const std::string& input)
22 : _input(input), _position(0) {
25std::string* SelectorTokenizer::next() {
26 std::regex tokenPattern(
"([LR]:|[\\w\\.:][\\.:\\-\\w]*|[\\,\\|\\-\\(\\)])");
29 std::string remaining = _input.substr(_position);
30 if (std::regex_search(remaining, match, tokenPattern)) {
31 _position += match.position() + match.length();
32 return new std::string(match.str());