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

Added on - 16 Sep 2019

  • Dissertation


  • 2


  • 311


  • 44


  • 0


Showing pages 1 to 1 of 2 pages
Create aPerlprogram that is simply a loop over a set of "Regular Expressions" that perform thetasks 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 trainingspaces 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 equalsign in =bcdefgbecomesa = "bcdefg"eg:a =bcdremainsa =bcdoAdd a semicolon (;) to theendof every line.oEvery line beginning with a comment marker (#) and containing additional textshould have one (and only one) space following the comment marker.For example:#some textbecomes....# 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 currentsection count:For example:[SVN]# Section: 1[......]# Section: 2etc.Submit:1.A file containing thePerl codetofulfilltheaboverequirements
You’re reading a preview

To View Complete Document

Become a Desklib Library Member.
Subscribe to our plans

Unlock This Document