in reply to [Class Assignment] Regex and Output Files
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, |
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: [Class Assignment] Regex and Output Files
by Anonymous Monk on Feb 20, 2015 at 16:13 UTC | |
by Anonymous Monk on Feb 20, 2015 at 18:21 UTC | |
by Don Coyote (Hermit) on Feb 21, 2015 at 14:05 UTC |