print q|^.*(??{ })\z| =~ m|^.*(??{$&ne'^.*(??{'.substr($&,7,36).'})\z'})\z| # outputs 1 #### $re = q{^.*(??{$&ne$re&&'(?!)'})\z};