Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
All I want to do is swap any number of spaces (the first 2) with ":"$line =~ s/.{2}\s+/:/;
Any idea what I'm doing wrong?$line = 'this has three spaces'; #before $line = 'this:has:three spaces'; #after
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: simple regex problem
by Enlil (Parson) on Mar 06, 2003 at 23:07 UTC | |
|
Re: simple regex problem
by CukiMnstr (Deacon) on Mar 06, 2003 at 23:13 UTC | |
by blakem (Monsignor) on Mar 07, 2003 at 00:27 UTC | |
by Hofmator (Curate) on Mar 07, 2003 at 12:16 UTC | |
|
Re: simple regex problem
by allolex (Curate) on Mar 06, 2003 at 22:55 UTC |