From owner-freebsd-hackers Fri Apr 5 7:43:40 2002 Delivered-To: freebsd-hackers@freebsd.org Received: from tninet.se (lennier.tninet.se [195.100.94.105]) by hub.freebsd.org (Postfix) with ESMTP id 04CB437C040; Fri, 5 Apr 2002 07:41:52 -0800 (PST) Received: from cs.umu.se (h16n1c1o1023.bredband.skanova.com [213.64.164.16]) by lennier.tninet.se (BMR ErlangTM/OTP 3.0) with ESMTP id 879726.21267.1018.0s18586114lennier ; Fri, 05 Apr 2002 17:41:07 +0200 Message-ID: <3CADC594.E56C89FB@cs.umu.se> Date: Fri, 05 Apr 2002 17:41:08 +0200 From: Paul Everlund X-Mailer: Mozilla 4.77 [en] (Windows NT 5.0; U) X-Accept-Language: sv,en MIME-Version: 1.0 To: Ilia Chipitsine Cc: Bernd Walter , questions@FreeBSD.ORG, hackers@FreeBSD.ORG Subject: Re: Perl thing References: Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Ilia Chipitsine wrote: > > Salut, Bernd Walter ! > > On Fri, 5 Apr 2002, Bernd Walter wrote: > > > On Fri, Apr 05, 2002 at 07:56:53PM +0600, Ilia Chipitsine wrote: > > > Dear Sirs, > > > > > > 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. > > > > strsep(3) > > Especially the exmaple in the manpage should be interesting for you. > > :)))))))) > > it doesn't help with > > @t = split(/from=<|>/,$a); > > where "from<|>" is regex. strsep knows nothing about regex. As someone wrote a regex thingy for Perl (in C I pressume), then you should be able to use the str-functions in the C-libraries to write your own very specialized function for splitting up the string. It might not be general, it might not be as nice as split, but it should work. Good luck! Best regards, Paul To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message