Date: Fri, 29 Mar 2002 11:01:02 -0800 From: Lars Eggert <larse@ISI.EDU> To: Ilia Chipitsine <ilia@cgu.chel.su> Cc: questions@FreeBSD.ORG, hackers@FreeBSD.ORG Subject: Re: perfomance and regular expressions Message-ID: <3CA4B9EE.6050001@isi.edu> References: <Pine.BSF.4.10.10203292117510.1096-100000@jane.poka.net>
next in thread | previous in thread | raw e-mail | index | archive | help
[-- Attachment #1 --]
Ilia Chipitsine wrote:
> I'm currently implementing a program which will run thousands and
> thousands times. It uses regular expressions.
>
> something really simple, like
>
> regex_t re;
> regcomp(&re,"^[0123456789abcdefghijklmnopqrstuvwxyz]{1,8}$",
> REG_EXTENDED+REG_ICASE);
> return(!regexec(&re,name,0,0,0));
>
> so, questions are:
>
> 1) is it faster to "compile" regex once and load it from file every time
> program starts ?
>
> 2) how to store in a file data of type "regex_t" ??
Try using flex.
Lars
--
Lars Eggert <larse@isi.edu> Information Sciences Institute
http://www.isi.edu/larse/ University of Southern California
[-- Attachment #2 --]
0 *H
010 + 0 *H
00G0
*H
010 UZA10UWestern Cape10U Cape Town10
U
Thawte10UCertificate Services1(0&UPersonal Freemail RSA 2000.8.300
010824164000Z
020824164000Z0T10
UEggert1
0U*Lars10ULars Eggert10 *H
larse@isi.edu00
*H
0 |\Pw v~~FDooӦA\- Cˀ4.)&{肋,z(ܷر߈T7_'txGH^tt/ҹB8%t<#ֲN V0T0*+e!0 00L2uMyffBNUbNJJcdZ2s0U0
larse@isi.edu0U0 0
*H
aJPMՒ ]cѭC+kS+wZ1gY",YT41
j6:~℩D~Kؚl=u(ՎM?cF7@}T00G0
*H
010 UZA10UWestern Cape10U Cape Town10
U
Thawte10UCertificate Services1(0&UPersonal Freemail RSA 2000.8.300
010824164000Z
020824164000Z0T10
UEggert1
0U*Lars10ULars Eggert10 *H
larse@isi.edu00
*H
0 |\Pw v~~FDooӦA\- Cˀ4.)&{肋,z(ܷر߈T7_'txGH^tt/ҹB8%t<#ֲN V0T0*+e!0 00L2uMyffBNUbNJJcdZ2s0U0
larse@isi.edu0U0 0
*H
aJPMՒ ]cѭC+kS+wZ1gY",YT41
j6:~℩D~Kؚl=u(ՎM?cF7@}T0)00
*H
010 UZA10UWestern Cape10U Cape Town10U
Thawte Consulting1(0&UCertification Services Division1$0"UThawte Personal Freemail CA1+0) *H
personal-freemail@thawte.com0
000830000000Z
020829235959Z010 UZA10UWestern Cape10U Cape Town10
U
Thawte10UCertificate Services1(0&UPersonal Freemail RSA 2000.8.3000
*H
0 32c %E>nx'gڈD)c5*mp<ܮto034qmOe
KaU5u'rװ|CBPQ<9TIf - ki N0L0)U"0 010UPrivateLabel1-2970U0 0U0
*H
so&e4KYbDI
j&*bctmSK8P:l4撜n# KrgPo.XPWՈ9[9}4%MjÑ/<RbH100010 UZA10UWestern Cape10U Cape Town10
U
Thawte10UCertificate Services1(0&UPersonal Freemail RSA 2000.8.30G0 + a0 *H
1 *H
0 *H
1
020329190103Z0# *H
1HY7P[-VuxHyc#0R *H
1E0C0
*H
0*H
0
*H
@0+0
*H
(0*H
1010 UZA10UWestern Cape10U Cape Town10
U
Thawte10UCertificate Services1(0&UPersonal Freemail RSA 2000.8.30G0
*H
"wڏef0|lEE8$o67כu*H|AbHዖVyT\KB$UYΧ9~JΚg'$yS(M;UnSc"x|0
sEH&