Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 9 Feb 2001 17:12:54 +0700
From:      John Indra <john@office.naver.co.id>
To:        Edwin Groothuis <mavetju@chello.nl>, freebsd-questions@freebsd.org
Subject:   Re: Crafting Perl RE...
Message-ID:  <20010209171254.A34759@office.naver.co.id>
In-Reply-To: <20010209104306.F62745@d9168.upc-d.chello.nl>; from mavetju@chello.nl on Fri, Feb 09, 2001 at 10:43:07AM %2B0100
References:  <20010209160849.A97806@office.naver.co.id> <20010209104306.F62745@d9168.upc-d.chello.nl>

next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, Feb 09, 2001 at 10:43:07AM +0100, Edwin Groothuis wrote:

>[~] edwin@kludge>perl -e '$s="blaat.test.jpg";$s=~/\.(\w+)$/; print $1,"\n"'
>jpg

So the RE is /\.(\w)$/
Hmm... I am not using this from the first place to anticipate "extensions
that has weird characters", say:

$string = "test.w?g"

If I do:
$string =~ m#\.(\w)$#

Then, $1 will fails to catch w?g right?

/john



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?20010209171254.A34759>