Consider again the sed code of Figure 14.1. It is tempting to write the first of the
Question:
Consider again the sed code of Figure 14.1. It is tempting to write the first of the compound statements as follows (note the differences in the three substitution commands):
Explain why this doesn’t work.
Figure 14.1:
Transcribed Image Text:
# label (target for branch): :top /< [hH] [123]>.*<\/ [hH] [123]>/ { ;# match whole heading ;# save copy of pattern space ;# delete text after closing tag ;# delete text before opening tag h s/\(<\/[hH] [123]>\). *$/\1/ s/".*\(<[hH] [123]>\)/\1/ ;# print what remains ;# retrieve saved pattern space ;# delete opening tag ;# delete closing tag s/< [hH] [123]>// s/<\/ [hH] [123] >// b top ;# and branch to top of script ;# match opening tag (only) /< [hH] [123]>/ { N ;# extend search to next line b top ;# and branch to top of script d. ;# if no match at all, delete
Fantastic news! We've Found the answer you've been seeking!
Step by Step Answer:
Answer rating: 66% (6 reviews)
Because regular expressions in sed are greedy the constructs on line...View the full answer
Answered By
Joseph Mwaura
I have been teaching college students in various subjects for 9 years now. Besides, I have been tutoring online with several tutoring companies from 2010 to date. The 9 years of experience as a tutor has enabled me to develop multiple tutoring skills and see thousands of students excel in their education and in life after school which gives me much pleasure. I have assisted students in essay writing and in doing academic research and this has helped me be well versed with the various writing styles such as APA, MLA, Chicago/ Turabian, Harvard. I am always ready to handle work at any hour and in any way as students specify. In my tutoring journey, excellence has always been my guiding standard.
4.00+
1+ Reviews
10+ Question Solved
Related Book For
Question Posted:
Students also viewed these Computer science questions
-
Explain why each compound is aromatic, antiaromatic, or nonaromatic. (a) (b) (c) (d) (e) (f) (g) (h) N: isoxazole 1.3-thiazole pyran pyrylium ion y-pyrone 1.2-dihydropyridine NH2 N:
-
The Tempting Cheesecake Company supplies cheesecakes to three large supermarket chains throughout Australia. Management has become concerned about the rising costs associated with the processing and...
-
Explain why the two following commands produce different results. SELECT DISTINCT COUNT (V_CODE) FROM PRODUCT; SELECT COUNT (DISTINCT V_CODE) FROM PRODUCT;
-
Discuss the importance of asset allocation when developing a portfolio. In general, what is the conventional guidance in terms of allocating assets across the following three asset classes (equities,...
-
A heat engine receives heat from a source at 1500 K at a rate of 600 kJ/s and rejects the waste heat to a sink at 300 K. If the power output of the engine is 400 kW, the second- law efficiency of...
-
In problem write each function in terms of unit step functions. Find the Laplace transform of the given function. [2, f(t) 1-2, 0
-
A surface condenser is required to deal with \(20,000 \mathrm{~kg}\) of steam per hour. The air leakage is estimated at \(0.3 \mathrm{~kg}\) per \(1000 \mathrm{~kg}\) of steam. The steam enters the...
-
A 90% interest in Saxton Corporation was purchased by Palm Incorporated on January 2, 2011. The capital stock balance of Saxton Corporation was $3,000,000 on this date, and the balance in retained...
-
Your text talks about Therapeutic Use Exemptions (TUE) and how they play a role in modern drug testing. You've also read a portion of the Major League Baseball Joint Drug Prevention and Treatment...
-
Poulsbo Kayak Company makes molded plastic kayaks. Standard costs for an entry-level whitewater kayak are as follows: Direct materials, 60 lb. at $5.50/lb. $330 Direct labor, 1.5 hr. at $16/hrs. 24...
-
Consider the following regular expression in Perl: /^(?:((?:ab)+) |a((?:ba)*))$/. Describe, in English, the set of strings it will match. Show a natural NFA for this set, together with the minimal...
-
Perl provides an alternative (?:. . . ) form of parentheses that supports grouping in regular expressions without performing capture. Using this syntax, Example 14.57 could have been written as...
-
(a) The isoelectric point (pI) of phenylalanine is pH 5.5. Draw the structure of the major form of phenylalanine at pH values of 1, 5.5, and 11. (b) The isoelectric point of histidine is pH 7.6. Draw...
-
Explain expenditure-switching as a means to correct a current account deficit.
-
Suppose that you buy an outperformance call option with the following terms: - Portfolio X consists of bouds with a market value of \(\$ 5\) million. - Portfolio Y consists of stocks with a market...
-
a. What is meant by "soft dollars"? b. What is the concern with soft dollars?
-
Make a list of the goods you commonly use that are imported. These can include food, clothing, electronics etc. If possible, identify the source of the goods.
-
Explain why a current account deficit may result in a depreciation of a country's currency.
-
The drawing shows light incident on a polarizer whose transmission axis is parallel to the z axis. The polarizer is rotated clockwise through an angle . The average intensity of the incident light is...
-
Planning: Creating an Audience Profile; Collaboration: Team Projects. Compare the Facebook pages of three companies in the same industry. Analyze the content on all available tabs. What can you...
-
We need to upgrade a channel to a higher bandwidth. Answer the following questions: a. How is the rate improved if we double the bandwidth? b. How is the rate improved if we double the SNR?
-
What is the theoretical capacity of a channel in each of the following cases? a. Bandwidth: 20 KHz SNR dB = 40 b. Bandwidth: 200 KHz SNR dB = 4 c. Bandwidth: 1 MHz SNR dB = 20
-
If the peak voltage value of a signal is 20 times the peak voltage value of the noise, what is the SNR? What is the SNR dB ?
-
The imposition of a ceiling on the length of time a criminal case should take to get to trial is a multifaceted issue, balancing the defendant's right to a timely trial with the complexities of...
-
Discuss three changes written into the Constitution in 1789 that changed the government from what it was under the ArticIes of Confederation?
-
Assume South Park is initially closed to trade. Domestic supply and demand for winter hats is given by the following equations: D = 60 - 4P, S = 2P - 6. a. Suppose South Park opens up to trade and...
Additive Number Theory Of Polynomials Over A Finite Field 1st Edition - ISBN: 5893214758 - Free Book
Study smarter with the SolutionInn App