From owner-freebsd-questions Fri Apr 5 8:15: 2 2002 Delivered-To: freebsd-questions@freebsd.org Received: from roc-66-66-72-6.rochester.rr.com (roc-66-66-72-6.rochester.rr.com [66.66.72.6]) by hub.freebsd.org (Postfix) with ESMTP id D0E5F37B41C for ; Fri, 5 Apr 2002 08:14:53 -0800 (PST) Received: by roc-66-66-72-6.rochester.rr.com (Postfix, from userid 1000) id 580FE901A00; Fri, 5 Apr 2002 11:13:16 -0500 (EST) Date: Fri, 5 Apr 2002 11:13:16 -0500 From: mpd To: Ilia Chipitsine Cc: questions@freebsd.org Subject: Re: Perl thing Message-ID: <20020405111316.A94450@rochester.rr.com> References: <20020405090831.A93228@rochester.rr.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: ; from ilia@cgu.chel.su on Fri, Apr 05, 2002 at 09:12:59PM +0600 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 On Fri, Apr 05, 2002 at 09:12:59PM +0600, Ilia Chipitsine wrote: > > cc: to hackers removed. > > > > > Perl has very useful "split" function, it "split"s a string according > > > arbitrary regular expression. Is there's such a C function ? > > > I'm moving few programs from Perl to C. > > > > > > > There's no standard function in C that will do this. > > Writing one to do so is trivial, though. > > > > There is a non-standard function called bufsplit() > > that would probably do what you want, but it's > > not part of the FreeBSD C library. > > is it a part of ports collection ? > > make search key=bufsplit > > doesn't say anything about it... No. It's just a non-standard C function. It's available on other Unices, but using it will cause your programs to be non-portable. The same goes for using strsep() as suggested earlier. strsep() is also not a standard function. I don't believe it handles regular expressions, either. mike -- ___________________________________________________________ "POKEY I LOVE YOUR NEW SHED!" - Little Girl from "POKEY AND THE SHED" To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message