Help for this page

Select Code to Download


  1. or download this
    $catreg = "^(<[A-Za-z0-9]+>)*<H1>(<[A-Za-z0-9]+>)*([A-Za-z0-9]+)";
    
  2. or download this
    if ( m!$catreg! ) {
    
  3. or download this
    m!^(<[A-Za-z0-9]+>)*<H1>(<[A-Za-z0-9]+>)*([A-Za-z0-9]+)!
    
  4. or download this
                  # the lack of a $var =~ here indicates
                  # that we are matching against $_
    ...
    ([A-Za-z0-9]+)    # matches sequential alphanumerics and
                      # captures all into $3
    !                 # end of regex
    
  5. or download this
    $catreg = "^(<[A-Za-z0-9]+>)*<H1>(<[A-Za-z0-9]+>)*([A-Za-z0-9]+)";
    
    ...
    } else {
        print "No Match\n";
    }
    
  6. or download this
    $_='<h1>foo</h1>blah<H1>bar</H1>more blah';
    
    while (m!<h1>(.*?)</h1>!ig) {
        print "Found $1\n";
    }