Assessment Brief
Create a Perl program that is simply a loop over a set of “Regular Expressions” that perform the tasks described below. Use the attached file SampleConfig.txt as input. Note1: The Alice.txt file will only be used as part of an “In Lab” example/tutorial.Note2: Though this is a bit assignment is a bit contrived, it does represent the types of actual text manipulations that might be performed over many large files.Instructions:Using the attached SampleConfig.txt file, provide a Perl regular expression for each of the following tasks:Remove any leading or trailing space from each line.Replace all of the occurrences of a full line of # characters (ignoring leading or training spaces and lines with just 1 #) with the following: # ———- #Change any URL ending in .htm to end with .htmlFor any set of multiple words following an equal sign (=), place what follows the equal sign in quotes.eg: a = bcd efg becomes a = “bcd efg”eg: a = bcd remains a = bcdAdd a semicolon (;) to the end of every line.Every 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 text Replace any pattern in the form of [__UPPER-CASE CHARACTERS__] with (lower-case characters)ie: Open square bracket + two underscores + upper-case text + two underscores + close square bracketeg:[__SOMEDATA__] becomes [somedata]Follow every “config section” with a comment that indicates the current section count:For example: [SVN] # Section: 1 [……] # Section: 2 etc.Submit:A file containing the Perl code to fulfill the above requirementsA version of the SampleConfig.txt file incorporating all of the above changes.
🌐
Studying abroad? We know your country's system.
UK student? We use OSCOLA, Harvard, or Vancouver. US college? APA 7th or Chicago. Australian? We know APA 6th, AGLC, and more. One platform, global expertise.
Serving students in 70+ countries