From owner-freebsd-questions@FreeBSD.ORG Wed Jun 22 07:30:59 2005 Return-Path: X-Original-To: questions@freebsd.org 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 80C3816A41C for ; Wed, 22 Jun 2005 07:30:59 +0000 (GMT) (envelope-from ut@bhi-hamburg.de) Received: from mail.terralink.de (mail.tlink.de [217.9.16.16]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3358743D4C for ; Wed, 22 Jun 2005 07:30:58 +0000 (GMT) (envelope-from ut@bhi-hamburg.de) Received: from schweinkram.pleach-hamburg.de (p548ED273.dip.t-dialin.net [84.142.210.115]) by mail.terralink.de (Postfix) with ESMTP id 4C7B1BA67; Wed, 22 Jun 2005 09:30:59 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by schweinkram.pleach-hamburg.de (Postfix) with ESMTP id 423C36A8D6A; Wed, 22 Jun 2005 09:29:03 +0200 (CEST) Received: from by localhost (amavisd-new, port ) id bMOdgQEq; Wed, 22 Jun 2005 09:29:01 +0200 (CEST) Received: by schweinkram.pleach-hamburg.de (Postfix, from userid 65534) id B75016A8D4A; Wed, 22 Jun 2005 09:29:01 +0200 (CEST) Received: from [192.168.1.31] (remote1.pleach-hamburg.de [192.168.1.31]) by schweinkram.pleach-hamburg.de (Postfix) with ESMTP id 2CB676A5E3D; Wed, 22 Jun 2005 09:28:57 +0200 (CEST) Message-ID: <42B91313.9050807@bhi-hamburg.de> Date: Wed, 22 Jun 2005 09:28:19 +0200 From: Titus von Boxberg User-Agent: Mozilla Thunderbird 1.0 (Windows/20041206) X-Accept-Language: de-DE, de, en-us, en MIME-Version: 1.0 To: Olivier Nicole References: <200506220411.j5M4BQ6G087888@banyan.cs.ait.ac.th> In-Reply-To: <200506220411.j5M4BQ6G087888@banyan.cs.ait.ac.th> Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Checker-Version: SpamAssassin 2.60 (1.212-2003-09-23-exp) on schweinkram.pleach-hamburg.de X-Spam-Status: No, hits=-1.4 required=5.0 tests=BAYES_20 autolearn=no version=2.60 X-Spam-Level: X-Virus-Scanned: by amavisd-new at pleach-hamburg.de Cc: questions@freebsd.org Subject: Re: Using regex(3) X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Jun 2005 07:30:59 -0000 Olivier Nicole schrieb: > Hi, > > I must missunderstand how to use regex(3). no, you're misunderstanding regoff_t or printf. it's a 64 bit type. thus your printf should read: ret=regexec(preg, string, nmatch, pmatch, 0); printf("return from regexec=%d\nnmatch=%d\np0.so=%lld p0.eo=%lld\np1.so=%lld p1.eo=%lld\np2.so=%lld p2.eo=%lld\np3.so=%lld p3.eo=%lld\n", ret, nmatch, pmatch[0].rm_so, pmatch[0].rm_eo, pmatch[1].rm_so, pmatch[1].rm_eo, pmatch[2].rm_so, pmatch[2].rm_eo, pmatch[3].rm_so, pmatch[3].rm_eo ); regards titus