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,
| Athanasius <°(((>< contra mundum | Iustus alius egestas vitae, eros Piratica, |
In reply to Re: [Class Assignment] Regex and Output Files
by Athanasius
in thread [Class Assignment] Regex and Output Files
by Hayest
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |