in reply to Regular Expression: search and replace
This is my first answer after joining perlmonks. Answer is already posted, but here is perl one liner for doing same thing.
'num' is a file containing numbers.
$ cat num Hello 12345 world 23456 777381 89651
perl one liner which you can execute in command line for your answer.
A minor correction. Same can be achieved through.$ perl -lpne 's/\d/qw(zero one two three four five six seven eight nin +e)[$&]/ge' num
$ perl -lpe 's/\d/qw(zero one two three four five six seven eight nine +)[$&]/ge'
Once you finish regexes, you can have a look into perl command line options to know what magic is going on in above command.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Regular Expression: search and replace
by toolic (Bishop) on Oct 11, 2013 at 19:53 UTC | |
by yateeshMN (Initiate) on Oct 11, 2013 at 20:26 UTC |