princepawn has asked for the wisdom of the Perl Monks concerning the following question:
And I was hoping to put a period after every number which was indicating the move number (ie, the 1, the 2, the 3, .. etc, but not the "6" in Nf6. Here is my code: perl -ne 's{\b(\d+)\b}{\1.}g' moves1 d4 f5 2 Nc3 d5 3 Bg5 c6 4 e4 fxe4 5 f3 exf3 6 Nxf3 Bg4 7 h +3 Bxf3 8 Qxf3 Nf6 9 Bd3 Nbd7 10 0-0-0 Qc7 11 Rhe1 0-0-0 12 Bf4 Qb6 +13 Re6 g6 14 Nb5 Ne8 15 Be2 a6 16 Qa3 g5 17 Na7+!! Qxa7 18 R +xc6+! bxc\ 6 19 Bxa6+ Qb7 20 Qa5
Does anyone know why it doesn't work?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: [perlre] appending a "." to numbers inside word boundaries
by BrowserUk (Patriarch) on Oct 27, 2002 at 13:39 UTC | |
|
Re: [perlre] appending a "." to numbers inside word boundaries
by fruiture (Curate) on Oct 27, 2002 at 13:43 UTC |