Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Answer: Subroutines in a regex?

( #69689=categorized answer: print w/ replies, xml ) Need Help??

Q&A > regular expressions > Subroutines in a regex? - Answer contributed by busunsl

use
s/SUM(\d*)/sum($1)/eg
this will execute the subroutine.

Log In?
Username:
Password:

What's my password?
Create A New User
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (6)
As of 2016-08-23 21:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    The best thing I ever won in a lottery was:















    Results (331 votes). Check out past polls.