develooper Front page | perl.beginners | Postings from March 2002

re:Regexp needed

Thread Previous
From:
Jorge Goncalvez
Date:
March 5, 2002 02:04
Subject:
re:Regexp needed
Message ID:
200203051003.LAA24113@cabs40.col.bsf.alcatel.fr
hi, i have this:
my ($Path) = $MountsPath =~ /(.+?)cygwin/;
but I wanted to get rid of the "/".
because $MountsPath could be c:/cygwin or c:/xyz/cygwin or c:/xyz/zyx/cygwin and 
i wanted $Path = c: or c:/xyz or c:/xyz/zyx .
And now $Path= c:/ or c:/xyz or c:/xyz/zyx.
How can I do ?
thanks.


Thread Previous


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About