Jun 6, 2013, 11:21 AM
Consider this session under the debugger:
Re: [kaza_perl] How to match a function of back reference?
DB<25> print $s;
DB<26> ($c, $d) = $s =~ m/^some_string_(\d+)_more_string_(\d+)/;
DB<27> print "true! \n" if $c == $d + 1;
Quite easy, isn't it?
But the calculation within the regex, I don't think you can do that.
(This post was edited by Laurent_R on Jun 6, 2013, 11:22 AM)