Loading ...
Sorry, an error occurred while loading the content.
 

Re: regular expresssion

Expand Messages
  • shaileshsp@yahoo.com
    thankyou verymuch for your help..it worked, shailesh patel ... $6, n ; ... http://docs.yahoo.com/info/terms/
    Message 1 of 3 , Oct 13, 2001
      thankyou verymuch for your help..it worked,
      shailesh patel

      --- In perl-beginner@y..., Trap 13 <bugbuilder@f...> wrote:
      > On Fri, Oct 12, 2001 at 10:55:44PM -0000, shaileshsp@y... wrote:
      > > Hi everybody,
      > > i am new to perl,My problem is that i have to parse a file name
      > >
      > > my code is:
      > > use File::Basename;
      > > fileparse_set_fstype(MSWin32);
      > > $path = "C:\\CProjects\\1234_BW_SN_Beak.h" ;
      > > ($name,$dir,$ext,)= fileparse($path,'\_.*?');
      > >
      > > the output i get using this code is
      > > dir = c:\CProjects\
      > > name is 1234
      > > ext is _BW_SN_Beak.h
      > >
      > > but i want the output to be something like
      > > dir = c:\CProjects\
      > > name is 1234
      > > title= BW
      > > reference = SN
      > > file name = beak
      > > ext = .h
      > >
      >
      > #!/usr/bin/perl
      >
      >
      > $path = "C:\\CProjects\\1234_BW_SN_Beak.h" ;
      >
      >
      > $path =~ m/(.*)\\([^_]+)_([^_]+)_([^_]+)_([^.]+)(\..*)$/;
      >
      >
      > print $1, ' | ', $2, ' | ', $3, ' | ', $4, ' | ', $5, ' | ',
      $6, "\n";
      >
      >
      >
      > > any help will be highly appreciated,
      > > thank you,
      > > shailesh patel
      > > shaileshp@y...
      > >
      > >
      > >
      > >
      > >
      > > Your use of Yahoo! Groups is subject to
      http://docs.yahoo.com/info/terms/
      > >
      > >
      > >
      >
      > --
      > Ce qu'il y a d'enivrant dans le mauvais goût, c'est le plaisir
      > aristocratique de déplaire.
      >
      > Charles Baudelaire - Mon coeur mis à nu.
    Your message has been successfully submitted and would be delivered to recipients shortly.