Help for this page

Select Code to Download


  1. or download this
    my $string = "Field1:  one";
    foreach my $reobj ( qr/Field1/, qr/Field2/, qr/Field3/) {
        print "$1\n" if $string =~ m/$reobj:  (\w{3})/;
    }
    
  2. or download this
    my $string = "Field1:  one";
    my @regexobjs = ( qr/Field1/, qr/Field2/, qr/Field3/ );
    foreach my $reobj ( @regexobjs ) {
    # The rest is the same as above.....