Help for this page

Select Code to Download


  1. or download this
    my $open = qr{
      < [a-zA-Z][a-zA-Z0-9]*
    ...
      \s*
      >
    }x;
    
  2. or download this
    my $close = qr{
      < / \s* [a-zA-Z][a-zA-Z0-9]* \s* >
    }x;
    
  3. or download this
    # the following are comments:
    # <!-- ab -- cd -->   <!-- ab -->    <!---->
    ...
      )*                # 0 or more times
      -- \s* >          # --, space, then >
    }x;
    
  4. or download this
    while ($HTML =~ /\G($open|$close|$comment|[^<]+)/g) {
      # do something with $1
    }
    
  5. or download this
    # requires the (?{...}) structure
    use re 'eval';
    ...
    }xg) {
      # do something with $1 and $STATE
    }