how to match regular expression from right to left
From: Liang (leo2002chen_at_hotmail.com)
Date: 08/26/04
- Previous message: Chris Cole: "Re: Need help: perl script to FTP"
- Next in thread: Gunnar Hjalmarsson: "Re: how to match regular expression from right to left"
- Reply: Gunnar Hjalmarsson: "Re: how to match regular expression from right to left"
- Reply: nobull_at_mail.com: "Re: how to match regular expression from right to left"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Thu, 26 Aug 2004 17:32:00 +0800
hi, I'm a newbie to perl :-p
I want to parse this kind of string:
/main/abcd/efgh/hhh/3
to get the rightmost string that is enclosed in '/'. In this case, it's
'hhh'.
So, how to do this in Perl? something as '=~ /\/(.*)\//' ?
or use index()?
Thanks in advance,
Liang
- Previous message: Chris Cole: "Re: Need help: perl script to FTP"
- Next in thread: Gunnar Hjalmarsson: "Re: how to match regular expression from right to left"
- Reply: Gunnar Hjalmarsson: "Re: how to match regular expression from right to left"
- Reply: nobull_at_mail.com: "Re: how to match regular expression from right to left"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]