heidkamp has asked for the wisdom of the Perl Monks concerning the following question: ⭐ (regular expressions)
I want to replace text with the results of a subroutine,
ie
Any ideas?
using (?{CODE}) is 0 width (no replacement), and I can't get it to work in the replacement section anyway.s/SUM(\d*)/sum($1)/g sub sum()
Any ideas?
Originally posted as a Categorized Question.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Subroutines in a regex?⭐
by busunsl (Vicar) on Apr 04, 2001 at 19:06 UTC | |
Re: Subroutines in a regex?
by alfie (Pilgrim) on Apr 05, 2001 at 13:39 UTC | |
by busunsl (Vicar) on Apr 05, 2001 at 14:56 UTC | |
Re: Subroutines in a regex?
by kilinrax (Deacon) on Apr 04, 2001 at 19:06 UTC |
Back to
Seekers of Perl Wisdom