Think about Loose Coupling | |
PerlMonks |
Re: [Class Assignment] Regex and Output Filesby Athanasius (Archbishop) |
on Feb 20, 2015 at 16:07 UTC ( [id://1117347]=note: print w/replies, xml ) | Need Help?? |
Hello Hayest, the word 'new'. ... create an output.txt file that switches all instances of 'new' regardless of case, to 'old'. Something to consider: Do you really want to replace every sequence of the characters ‘n’, ‘e’, ‘w’, or only those sequences which constitute the word ‘new’? For example, should ‘renewal’ be changed to ‘reoldal’ or left unchanged? If the latter, then you’ll need to use the regex assertion \b to match word boundaries. See “Assertions” in perlre, and the discussion of the word anchor in perlretut. Hope that helps,
In Section
Seekers of Perl Wisdom
|
|