From owner-freebsd-questions Fri Feb 9 2:13:17 2001 Delivered-To: freebsd-questions@freebsd.org Received: from dante.naver.co.id (unknown [202.155.86.83]) by hub.freebsd.org (Postfix) with ESMTP id 4536237B401 for ; Fri, 9 Feb 2001 02:13:00 -0800 (PST) Received: by dante.naver.co.id (Postfix, from userid 1000) id 936D81CB316; Fri, 9 Feb 2001 17:12:54 +0700 (JAVT) Date: Fri, 9 Feb 2001 17:12:54 +0700 From: John Indra To: Edwin Groothuis , freebsd-questions@freebsd.org Subject: Re: Crafting Perl RE... Message-ID: <20010209171254.A34759@office.naver.co.id> Mail-Followup-To: Edwin Groothuis , freebsd-questions@freebsd.org References: <20010209160849.A97806@office.naver.co.id> <20010209104306.F62745@d9168.upc-d.chello.nl> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20010209104306.F62745@d9168.upc-d.chello.nl>; from mavetju@chello.nl on Fri, Feb 09, 2001 at 10:43:07AM +0100 X-Mailer: Mutt 1.2.5i on FreeBSD 5.0-CURRENT i386 Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG 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