nerdexam
LPI

101-500 · Question #498

Given the following input stream: txt1.txt atxt.txt txtB.txt Which of the following regular expressions turns this input stream into the following output stream? txt1.bak.txt atxt.bak.txt txtB.bak.txt

The correct answer is B. s/txt/bak.txt/. You've hit your Sonnet limit · resets Jun 8, 9am (UTC)

GNU and Unix Commands

Question

Given the following input stream: txt1.txt atxt.txt txtB.txt Which of the following regular expressions turns this input stream into the following output stream? txt1.bak.txt atxt.bak.txt txtB.bak.txt

Options

  • As/^.txt/.bak/
  • Bs/txt/bak.txt/
  • Cs/txt$/bak.txt/
  • Ds/^txt$/.bak^/
  • Es/[.txt]/.bak$1/

How the community answered

(52 responses)
  • A
    4% (2)
  • B
    71% (37)
  • C
    13% (7)
  • D
    10% (5)
  • E
    2% (1)

Explanation

You've hit your Sonnet limit · resets Jun 8, 9am (UTC)

Topics

#regular expressions#sed substitution#text processing#pattern anchors

Community Discussion

No community discussion yet for this question.

Full 101-500 Practice