Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 9 Feb 2001 12:43:13 +0300
From:      "Artem Koutchine" <matrix@ipform.ru>
To:        "John Indra" <john@office.naver.co.id>, <freebsd-questions@freebsd.org>
Subject:   Re: Crafting Perl RE...
Message-ID:  <001c01c0927c$be056b00$0c00a8c0@ipform.ru>
References:  <20010209160849.A97806@office.naver.co.id>

next in thread | previous in thread | raw e-mail | index | archive | help

try
/(.*?)\.(\w+)$/

and use $2

----- Original Message -----
From: "John Indra" <john@office.naver.co.id>
To: <freebsd-questions@freebsd.org>
Sent: Friday, February 09, 2001 12:08 PM
Subject: Crafting Perl RE...


> Hi...
>
> Simple question but I don't know the answer. Suppose I have this
string:
> somefile.ins.jpg. I want to craft a Perl RE so it captures the jpg
part. I
> try this RE:
>
> $string =~ m#\.(.*)$#
>
> Unfortunately $1 captures ins.jpg, not jpg as I want.
>
> What RE to get it right?
>
> Thanks...
>
> /john
>
>
>
> To Unsubscribe: send mail to majordomo@FreeBSD.org
> with "unsubscribe freebsd-questions" in the body of the message
>



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?001c01c0927c$be056b00$0c00a8c0>