Help for this page

Select Code to Download


  1. or download this
    $regex = qr/$pattern/;
    $string =~ /foo${regex}bar/; # interpolate into larger patterns
    
  2. or download this
    my $re = qr!yes|no!;
    my $re2 = qr!\sthankyou!;
    my $bigre = $re.$re2;
    print "polite yes or no\n" if "yes thankyou" =~ $bigre;
    
  3. or download this
    my $bigre = qr!yes|no!.qr!\sthankyou!;