Help for this page

Select Code to Download


  1. or download this
    $_ = "a b=c";
    /(a)(.*)(?:b=(\w))?/;
    
    printf "\$2 is [%s]\n", defined $2 ? $2 : "undefined";
    printf "\$3 is [%s]\n", defined $3 ? $3 : "undefined";
    
  2. or download this
    $2 is [ b=c]
    $3 is [undefined]
    
  3. or download this
    $_ = "a b=c";
    /(a)(.*?)(?:b=(\w))?/;
    
    printf "\$2 is [%s]\n", defined $2 ? $2 : "undefined";
    printf "\$3 is [%s]\n", defined $3 ? $3 : "undefined";
    
  4. or download this
    $2 is []
    $3 is [undefined]