salmonix has asked for the wisdom of the Perl Monks concerning the following question:
I have a text file. This text file contains page numbers. Those should be \d-s, but there are typos like \d+o+ - when o stands for 0 (eg. 2oo). I am seeking for a solution to s/// those os to 0s.
The rule is if an o follows a \d, make it 0 - for each o, in one step. Perhaps the solution is trivial. I do not know. But I am lost somewhere.
I have this:s/(?<=\d|o)o/0/g, but this will also change \woO too, like foo -> fo0. And its not good.
(A bit later)
Pacem fortunamque, Domini!
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: s/// for \dOO for typos
by JavaFan (Canon) on Oct 28, 2010 at 09:41 UTC | |
|
Re: s/// for \dOO for typos
by Marshall (Canon) on Oct 28, 2010 at 11:51 UTC | |
|
Re: s/// for \dOO for typos
by ig (Vicar) on Oct 28, 2010 at 12:14 UTC | |
by wallisds (Beadle) on Oct 28, 2010 at 18:34 UTC | |
|
Re: s/// for \dOO for typos
by use perl::always (Initiate) on Oct 28, 2010 at 09:29 UTC |