Help for this page

Select Code to Download


  1. or download this
    my $dn = 'corpid=xxxxxx,ou=people,o=corp';
    my ($ou) = $dn =~ /ou=(.*?),/;
    print "ou = $ou\n";
    
  2. or download this
           Sometimes minimal matching can help a lot.  Imagine you’d like 
    +to match
           everything between "foo" and "bar".  Initially, you write somet
    +hing
    ...
    
               if ( /foo(.*?)bar/ ) { print "got <$1>\n" }
             got <d is under the >