Help for this page

Select Code to Download


  1. or download this
    $re = "\.";
    
    ...
    foreach (qw( . a )) {
       print("$_ ", /$re/ ? "matches" : "doesn't match", " $re\n");
    }
    
  2. or download this
    . matches .
    a matches .
    . matches (?-xism:\.)
    a doesn't match (?-xism:\.)
    
  3. or download this
    $var = '...';
    $re = qr/abc\Q$var\Eghi/;
    ...
    )) {
       print("$_ ", /$re/ ? "matches" : "doesn't match", "\n");
    }
    
  4. or download this
    abcdefghi doesn't match
    abc...ghi matches