Embercode
✕
Character Arrays and StringsQuick quiz

Words and regex

8 questions. Covers Regex basics.

Questions 1 to 5 of 8

  1. 1. Using reverse_words_with_list from the lesson, what does this print? ``cpp std::cout << "[" << reverse_words_with_list(" a b ") << "]\n"; ``
  2. 2. Using reverse_words_in_place from the lesson, what does this print? ``cpp std::cout << "[" << reverse_words_in_place(" one two ") << "]\n"; ``
  3. 3. What does this print? ``cpp std::regex digits(R"(\d+)"); std::string text = "abc123def45"; std::smatch found; std::regex_search(text, found, digits); std::cout << found.position() << " " << found.str(); ``
  4. 4. In the in-place method, after removing extra spaces and reversing the whole string, the last step reverses each ___ again so its spelling is normal. Type one word.

    Type your answer.

  5. 5. Which standard header must be included to use std::regex? Type the header name without the angle brackets.

    Type your answer.

5 question(s) left on this page.

Typed answers ignore extra spaces and, for most questions, capital letters.