Re: How to take apart the filepath using regular expression?



Marco wrote:
> How can I use regular expression to take it apart?

Why would you want to?

#!/usr/bin/perl

use File::Basename; # Standard module included in Perl

my $filename = '\Inetpub\wwwroot/Mail Group';

my ($name, $path) = fileparse($filename,@suffixlist);
print "$name\n$path\n";

__END__

--
http://DavidFilmer.com

.



Relevant Pages

  • Re: Changing date field in a text file...
    ... > you understand a little more about the Perl language. ... > seeing those quotes anyway. ... Those two digits will be the day number. ... The regular expression is the contents of the first pair ...
    (comp.unix.shell)
  • [Full-disclosure] [ GLSA 200711-28 ] Perl: Buffer overflow
    ... A buffer overflow in the Regular Expression engine in Perl possibly ... the Gentoo Security Website: ...
    (Full-Disclosure)
  • [ GLSA 200711-28 ] Perl: Buffer overflow
    ... A buffer overflow in the Regular Expression engine in Perl possibly ... the Gentoo Security Website: ...
    (Bugtraq)
  • Re: Please any one suggest me some project ideas
    ... implements the same thing as the regexp. ... All programming languages involve some degree of tradeoff between ... but documenting and testing a regular expression is no harder than ... Also perl allows whitespace and comments in regular expressions (if you ...
    (comp.programming)
  • Re: Changing date field in a text file...
    ... you understand a little more about the Perl language. ... But the shell "eats" quotes before sending the rest to Perl. ... Those two digits will be the day number. ... The regular expression is the contents of the first pair ...
    (comp.unix.shell)