This quiz is all about learning so you will not be penalised for any wrong answers. Just keep trying until you get everything right!
Correct!
Hmm, that’s not right. The command states that “foo” should be inserted before every “l”. This output only has a “foo” inserted before one or more “l”. You could replicate this output with the command
insert "foo" before every regex "l+"
Hmm, that’s not right. The command states that “foo” should be inserted before every “l”. This output has a “foo” inserted only before an “l” on its own. You could replicate this output with the command
insert "foo" before every regex "(?<!l)l(?!l)"
Hmm, that’s not right. The command will produce one of the outputs above.
Correct! The input starts at position 0, not position 1.
Hmm, that’s not right. Inserting text before the first character is the same as inserting text at the start.
Hmm, that’s not right. Prefixing text is the same as inserting text at the start.
Hmm, that’s not right. One of these commands does not match the command in question.
Correct! We want to match with the lowercase “o” and not the uppercase “O”. By default Rewrite will ignore case when checking for matches unless you use the
xcase modifier.
Hmm, that’s not right. This change won’t make any difference to the output as Rewrite ignores case when checking for matches by default.
Hmm, that’s not right. This change won’t make any difference to the output as Rewrite ignores case when checking for matches by default (even for regular expressions).
Hmm, that’s not right. This command will match with both the uppercase “O” and the lowercase “o” in the input unless we specify otherwise. This command will return
HeLlfooO WfoooRlD!
Correct! This command will add a space after every comma which is not already followed by a space.
Hmm, that’s not right. This will add the missing space after
amet,, however it will also add an additional space after elit,. As there is already a single space after elit,, there will now be two spaces after the word (elit,  sed). This is not an ideal solution.
Hmm, that’s not right. This command will insert a space after the literal word “,(?! )”. We want it to match with the regular expression (regex), not the word itself.
Hmm, that’s not right. The
xcase modifier will make sure it matches with the actual case of the word “,(?! )”. We want it to match with the regular expression (regex), not the word itself.
