Question

Write a regular expression with the grep command, which marks only and all underline parts, for...

  1. Write a regular expression with the grep command, which marks only and all underline parts, for the sentences listed below: (the file containing these sentences is called “Q1.txt”)

I want to pass the exam.

Is the PowerPoint file ready?

This is the moment to pay the bill.

  1. Write a regular expression with the grep command, which marks only and all underline parts, for the sentences listed below: (the file containing these sentences is called “Q1.txt”)

I want to pass the exam.

Is the PowerPoint file ready?

This is the moment to pay the bill.

Homework Answers

Answer #1

$ grep "I want to pass the exam.
Is the PowerPoint file ready?

This is the moment to pay the bill. [ I want to pass the exam. Is the PowerPoint file ready?

This is the moment to pay the bill.]" Q1.txt

here in the above grep we will be able to mark only and all underline parts, for the sentences present in Q1.txt file

we make use of [ ] brackets to find any part of the sentences given which is underlined in the file Q1.txt and the sentences written within " " double quotes will be marked as a whole ie all underlined parts of the given sentences.

-underline symbol is a special character and it does not have any meaning in grep command so we will use underline thing with the sentences given ie we underlined the sentences to be marked in the file.

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
Q1) Write a Python function partial_print, which takes one parameter, a string, and prints the first,...
Q1) Write a Python function partial_print, which takes one parameter, a string, and prints the first, third, fifth (and so on) characters of the strings, with each character both preceded and followed by the ^ symbol, and with a newline appearing after the last ^ symbol. The function returns no value; its goal is to print its output, but not to return it. Q2) Write a Python function called lines_of_code that takes a Path object as a parameter, which is...
Please check all my grammar, sentence structure, punctuation, transional words, verbs, topic sentences, etc. Please correct...
Please check all my grammar, sentence structure, punctuation, transional words, verbs, topic sentences, etc. Please correct like a strict teacher. Thank you very much for your help. There are few traits she looking for in the new leader and manager. She’s looking for people that open to learning, flexible, go above and beyond and learn to step outside their comfort zone no matter how difficult it may be. She wants people to take the initiative, she wants them to ask...
Write a Python 3 program called “parse.py” using the template for a Python program that we...
Write a Python 3 program called “parse.py” using the template for a Python program that we covered in this module. Note: Use this mod7.txt input file. Name your output file “output.txt”. Build your program using a main function and at least one other function. Give your input and output file names as command line arguments. Your program will read the input file, and will output the following information to the output file as well as printing it to the screen:...