That'd be (??{ code }) - live demo of the following (requires a modern browser; don't mind the "Subroutine redefined" warnings, I'll have to get around to fixing those):
use warnings; use strict; my $string = "more than one part\nanother sentence more than"; sub getone { qr/more/ } sub gettwo { qr/than/ } while ( $string =~ m{( (??{getone}) \s+ (??{gettwo}) )}xg ) { print "<$1>\n"; }
In reply to Re: Subroutine Reference in a Regexp?
by haukex
in thread Subroutine Reference in a Regexp?
by Amblikai
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |