Perl developer required – quick win for experienced perl dev
Project detail
your task is to develop following steps:
– use a provided XML with n of -nodes, containing the sub-nodes;
– name
– regex
– matchType (e.g. gmi for global, multiline, insensitive)
see attached a sample XML
provide a perl script to
– parse xml into (preferably class/instance way) in a sub: parseXmlFile
– read a text file into a string in a sub: readContentFile
– pass the string of the text file into a new sub: searchRegExs
– output found matches to console in sub: outputConsole
searchRegExes does
iterate over all named searchgroups and executes the regex value of the given node against the read text file
create a value class FoundRegExValue containing the fields:
– name
– regex
– matchType
– matchedValue
– matchedLine
on match, create a instance of FoundRegExValue which contains
– name of the searchgroup name
– regex of the searchgroup regex
– matchType, the searchgroup matchtype
– matchedValue, the found value
– matchedLine, the found line
delivery in a shared git repo (we share to you)
runs on perl 5.30 and later
with
XML::LibXML………………….ok (v2.0134)
XML::LibXSLT…………………ok (v1.99)
XML::Parser………………….ok (v2.46)