Ask a question to Desklib · AI bot

Ask NowBETA

Create a Perl program that is simply a loop over a set of

Added on -2019-09-16

| 2 pages
| 311 words
| 141 views

Trusted by 2+ million users,
1000+ happy students everyday

Create aPerlprogram that is simply a loop over a set of "Regular Expressions" that perform the tasks described below. Use the attached fileSampleConfig.txtas input.Instructions:Using the attachedSampleConfig.txtfile, provide a Perl regular expression for each of thefollowing tasks:1.Remove any leading or trailing space from each line.2.Replace all of the occurrences of afull line of#characters (ignoring leading or training spaces and lines with just 1 #) with the following:# ---------- #3.Change any URL ending in.htmto end with.html4.For any set of multiple words following an equal sign (=), place what follows the equal sign in quotes.eg:a =bcdefgbecomesa = "bcdefg"eg:a =bcdremains a =bcdoAdd a semicolon (;) to theendof every line.oEvery line beginning with a comment marker (#) and containing additional text should have one (and only one) space following the comment marker.For example: # some text becomes....# some textoReplace any pattern in the form of[__UPPER-CASECHARACTERS__]with(lower-casecharacters)ie:Open square bracket + two underscores + upper-case text +two underscores +close square bracketeg:[__SOMEDATA__]becomes[somedata]oFollow every "configsection" with a comment that indicates the current section count:For example:[SVN] # Section: 1 [......] # Section: 2etc.Submit:1.A file containing thePerl codetofulfilltheaboverequirements

Found this document preview useful?

You are reading a preview
Upload your documents to download
or
Become a Desklib member to get accesss

Students who viewed this