in reply to regex question
Whereas if you want to replace 1st field useuse strict; use warnings; my $str="1 2 3 4 5 6 7 8 9 10"; print "string is $str\n"; $str=~s/(?<=(\d\s){1})\d*/I am replaced/; print "string is $str";
Guesses for 10 th field ??$str=~s/(?<=(\d\s){0})\d*/I am replaced/;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: regex question
by johngg (Canon) on Nov 12, 2007 at 11:25 UTC | |
by convenientstore (Pilgrim) on Nov 12, 2007 at 15:55 UTC | |
by convenientstore (Pilgrim) on Nov 12, 2007 at 17:06 UTC | |
by johngg (Canon) on Nov 12, 2007 at 19:21 UTC |