On 2/9/07, Greg Oster <oster@cs.usask.ca> wrote:
> Scott Walde writes:
> > some of my uncommented historical perl code comes back to haunt me:
> >
> > $titles[$x]=~s/^.*\/([^\/]+)\.\w+$\..*/$1/;
>
> take: blah/foo/bar/baz.something
> and convert it to: baz
>
> Do I get a cookie?
I was in the middle of typing the exact same thing, and wondering if
I'd get a cookie too...
But why does he have the "$\..*". Catch trailing garbage for fun?
Received on Fri Feb 9 14:43:36 2007
This archive was generated by hypermail 2.1.8 : Fri Feb 09 2007 - 14:43:43 CST