narainhere has asked for the wisdom of the Perl Monks concerning the following question:
I expected the "iteration 1" and "iteration 2" to be "ITERATION 1" and "ITERATION 2", but its instead "uc(iteration 1)" and "uc(iteration 2)".#Assume the file is read to $str which contains $str="iteration 1 some information goes here machine name:[some meta-info] some multi-line info machine name:[some meta-info] some multi-line info iteration 2 some information goes here machine name:[some meta-info] some multi-line info machine name:[some meta-info] some multi-line info"; $str=~s/(iteration)(.*)/<B> uc($1)$2 <\/B>/; print $str;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Calling a function in regex substitution
by bart (Canon) on Sep 11, 2007 at 09:31 UTC | |
|
Re: Calling a function in regex substitution
by almut (Canon) on Sep 11, 2007 at 09:29 UTC | |
|
Re: Calling a function in regex substitution
by tcf03 (Deacon) on Sep 11, 2007 at 10:14 UTC | |
|
Re: Calling a function in regex substitution
by b4swine (Pilgrim) on Sep 11, 2007 at 09:30 UTC | |
by bart (Canon) on Sep 11, 2007 at 09:55 UTC |