Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 05 Apr 2002 17:41:08 +0200
From:      Paul Everlund <tdv94ped@cs.umu.se>
To:        Ilia Chipitsine <ilia@cgu.chel.su>
Cc:        Bernd Walter <ticso@cicely8.cicely.de>, questions@FreeBSD.ORG, hackers@FreeBSD.ORG
Subject:   Re: Perl thing
Message-ID:  <3CADC594.E56C89FB@cs.umu.se>
References:  <Pine.BSF.4.10.10204052113090.13313-100000@jane.poka.net>

next in thread | previous in thread | raw e-mail | index | archive | help
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-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3CADC594.E56C89FB>