in reply to Re: Regular Expressions, IF, Issue
in thread Regular Expressions, IF, Issue

sorry didn't explain well, trying to match the path even if it's shorter or not.

Replies are listed 'Best First'.
Re^3: Regular Expressions, IF, Issue
by Anonymous Monk on Apr 21, 2006 at 15:12 UTC
    This works now!
    #!/perl/bin/perl -w use strict; use warnings; use CGI qw/:standard/; use CGI::Carp qw(fatalsToBrowser); print header(); my $test_match = "D:/newdir/cgi-bin/testbin/errors/cgi-bin/testbin/"; #Here it will match just fine #$test_match =~/(.*?)\/([^\/]+)$/; $test_match =~/(.*)\/([^\/]+)\/$/; print "<br>*****$1*****$2****<br>"; #But in here the if doesn't, it will go to the ELSE, why? if($test_match =~/(.*?)\/([^\/]+)\/$/){ print "<br>^^^^$1^^$2^^^^<br>";} else{ print "No Match"; }