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

Added on - 16 Sep 2019

  • Dissertation

    type

  • 2

    pages

  • 311

    words

  • 44

    views

  • 0

    downloads

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 quotes.eg:a =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
desklib-logo
You’re reading a preview
card-image

To View Complete Document

Become a Desklib Library Member.
Subscribe to our plans

Unlock This Document