From owner-freebsd-questions@FreeBSD.ORG Sat May 29 16:17:47 2004 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E3BC116A4CE for ; Sat, 29 May 2004 16:17:47 -0700 (PDT) Received: from mta7.adelphia.net (mta7.adelphia.net [68.168.78.193]) by mx1.FreeBSD.org (Postfix) with ESMTP id 64A1843D41 for ; Sat, 29 May 2004 16:17:47 -0700 (PDT) (envelope-from Barbish3@adelphia.net) Received: from barbish ([67.20.101.71]) by mta13.adelphia.net (InterMail vM.5.01.06.08 201-253-122-130-108-20031117) with SMTP id <20040529231738.HCLK13425.mta13.adelphia.net@barbish> for ; Sat, 29 May 2004 19:17:38 -0400 From: "JJB" To: "freebsd-questions@FreeBSD. ORG" Date: Sat, 29 May 2004 19:17:37 -0400 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.6604 (9.0.2911.0) X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2800.1409 Importance: Normal Subject: Perl metacharacters X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: Barbish3@adelphia.net List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 29 May 2004 23:17:48 -0000 I have problems with 2 different if statements that use metacharacters. if (/(abuse\@.* )/) { $abuse_email = ${1}; } The data line it's reading looks like this, remarks: Please report all problems to abuse@xxxxx.xxx for probes, port scans etc. print($abuse_email) shows that it contains abuse@xxxxx.xxx for probes, port scans etc. The xxxxx.xxx can be any size, and any characters How do I change the if statement so I only get the abuse@xxxxx.xxx string? Problem 2. If (/(Net-.??-.??-.??-0-1)/) { $net_block = ${1}; } The data is (Net-xxx-xxx-xxx-0-1) Each xxx group will all ways by 1 to 3 digits long and different combinations every time. When matched I want $net_block just to hold Net-xxx-xxx-xxx-0-1 What is the correct syntax? Thanks