Help for this page

Select Code to Download


  1. or download this
    @regexps = qw( foo bar baz );
    @strings = qw( abc def ghi );
    ...
          $string =~ /$regexp/
       }
    }
    
  2. or download this
    >perl -Mre=debug -e"@regexps = qw( foo bar baz ); @strings = qw( abc d
    +ef ghi ); for $string (@strings) { for $regexp (@regexps) { $string =
    +~ /$regexp/ } }" 2>&1 | find "Compiling"
    Compiling REx `foo'
    ...
    Compiling REx `foo'
    Compiling REx `bar'
    Compiling REx `baz'
    
  3. or download this
    @regexps = qw( foo bar baz );
    @strings = qw( abc def ghi );
    ...
          $string =~ /$regexp/
       }
    }
    
  4. or download this
    >perl -Mre=debug -e"@regexps = qw( foo bar baz ); @strings = qw( abc d
    +ef ghi ); for $regexp (@regexps) { for $string (@strings) { $string =
    +~ /$regexp/ } }" 2>&1 | find "Compiling"
    Compiling REx `foo'
    Compiling REx `bar'
    Compiling REx `baz'
    
  5. or download this
    @regexps = map qr/$_/, qw( foo bar baz );   # All I did was add the qr
    +//.
    @strings = qw( abc def ghi );
    ...
          $string =~ /$regexp/
       }
    }
    
  6. or download this
    >perl -Mre=debug -e"@regexps = map qr/$_/, qw( foo bar baz ); @strings
    + = qw( abc def ghi ); for $string (@strings) { for $regexp (@regexps)
    + { $string =~ /$regexp/ } }" 2>&1 | find "Compiling"
    Compiling REx `foo'
    Compiling REx `bar'
    Compiling REx `baz'