Help for this page

Select Code to Download


  1. or download this
    my $something = 'This is a bang of a bing thing';
    
    ...
    if($something =~ m/($list)/i) {
      print "Found '$1' in '$something'\n";
    }
    
  2. or download this
    my @search = $something =~ m/($list)/ig;  # <- added the g modifier
    
  3. or download this
    while ($something =~ m/($list)/ig) {
        print "Found '$1' in '$something'\n";
    }
    
  4. or download this
    use strict;
    
    ...
    if ($something =~ m/(@list)/i) {
        print "Found '$1' in '$something'\n";
    }
    
  5. or download this
    Found 'bing bong bang' in 'This is a bang of a bing thing bing bong ba
    +ng'