[Chicago-talk] Probably and easy explanation I'm missing...

tiger peng tigerpeng2001 at yahoo.com
Thu Aug 24 14:30:12 PDT 2006


Try this:

perl -le '
@a=qw ( /a a/b /a/b /a/b/ \a \a\b a\b \a\b\ );
foreach (@a) {
  print;
  s/.*\\([^\\]+)$|.*\/([^\/]+)$/$1?$1:$2/e;
  print;
}
'


--- tiger peng <tigerpeng2001 at yahoo.com> wrote:

> 
> > s/.+\\([^\\]+)$|.+\/([^\/]+)$/$1/;
> 
> May be it try to say:
> 
> s/.*\\([^\\]+)$|.*\/([^\/]+)$/$1?$1:$2/e
> 
> Replace the whole line with the last field if the
> line
> contain '/' or '\' functions as field separator.
> 
> _______________________________________________
> Chicago-talk mailing list
> Chicago-talk at pm.org
> http://mail.pm.org/mailman/listinfo/chicago-talk
> 



More information about the Chicago-talk mailing list