List Info

Thread: Regular expression ;-)




Regular expression ;-)
user name
2006-02-16 16:28:41
Mark Knoop wrote:
> 
> I would do it this way too... but I have got a bit
sucked in to
> trying to do it using the model that was initially
suggested which
> makes a neat little puzzle. I am stumped though! Can
anyone find a
> way using the 
> 
> > $_="123";
> > /(XX)YY/;
> > print "$1\n" ; # result:
"123";
> 
> form?

Ok, try this:

$_="123";
/(.*?)(?:\.[^.]+)?$/;
print "$1\n";

-- 
Bowie
_______________________________________________
ActivePerl mailing list
ActivePerllistserv.ActiveState.com
To unsubscribe: http:/
/listserv.ActiveState.com/mailman/mysubs
[1]

about | contact  Other archives ( Real Estate discussion Medical topics )