in reply to Re^3: Using a capture in /(?{...})/
in thread Using a capture in /(?{...})/
You mean (??{ ... }). ((?{ ... }) is always zero-width.) Ok, the warning makes sense. There are (at least) two ways of hidding it:
1) Use no warnings 'regexp', or
2) refactor the regexp to hide that particular instance of the warning while leaving others on. For example,
$re0 = qr/ (??{ $re1 })* /x;
can be written as:
$re0 = qr/ (??{ $re1 }) (??{ $re0 }) | # Nothing /x;
and
$re0 = qr/ (??{ $re1 })+ /x;
can be written as:
$re0 = qr/ (??{ $re1 }) (??{ $re0_ }) /x; $re0_ = qr/ (??{ $re1 }) (??{ $re0_ }) | # Nothing /x;
and
$re0 = qr/ (??{ $re1 })? /x;
can be written as:
$re0 = qr/ (??{ $re1 }) | # Nothing /x;
|
|---|