From owner-freebsd-questions Wed Mar 12 2:38:33 2003 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 B885337B401 for ; Wed, 12 Mar 2003 02:38:32 -0800 (PST) Received: from mx0.gmx.net (mx0.gmx.net [213.165.64.100]) by mx1.FreeBSD.org (Postfix) with SMTP id 90CA343FAF for ; Wed, 12 Mar 2003 02:38:31 -0800 (PST) (envelope-from CapM@gmx.net) Received: (qmail 14246 invoked by uid 0); 12 Mar 2003 10:38:30 -0000 Date: Wed, 12 Mar 2003 11:38:29 +0100 (MET) From: Pascal Giannakakis To: freebsd-questions@freebsd.org MIME-Version: 1.0 Subject: X-Priority: 3 (Normal) X-Authenticated-Sender: #0000945514@gmx.net X-Authenticated-IP: [195.82.64.130] Message-ID: <22358.1047465509@www63.gmx.net> X-Mailer: WWW-Mail 1.6 (Global Message Exchange) X-Flags: 0001 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 8bit Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Hello, i want to extract a word with a regular expressions from a line of text. Here is what i currently have: grep -c -E 'Interesting ports on [a-zA-Z0-9-.]+ \((.+)\)' This will print lines (from nmap), but i need only the 1st match in parentheses, which is the IP in this case. What programm would i use to print what grep sees as \1, instead of the whole line? Thanx -- +++ GMX - Mail, Messaging & more http://www.gmx.net +++ Bitte lächeln! Fotogalerie online mit GMX ohne eigene Homepage! To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message