diff options
author | Yves Orton <demerphq@gmail.com> | 2007-04-04 03:46:26 +0200 |
---|---|---|
committer | Rafael Garcia-Suarez <rgarciasuarez@gmail.com> | 2007-04-04 08:32:37 +0000 |
commit | c737faaf63999e5a68ef536d362cea408ab990b7 (patch) | |
tree | 9bba722e0cb47bd933e45e1f909a7f265301deb0 /pod/perlreguts.pod | |
parent | 92a665d639a42192198e801676cccae0bd9afa83 (diff) | |
download | perl-c737faaf63999e5a68ef536d362cea408ab990b7.tar.gz |
Re: pmdynflags and thread safety
Message-ID: <9b18b3110704031646p7ac8dbearf9e41397a5f884d8@mail.gmail.com>
p4raw-id: //depot/perl@30841
Diffstat (limited to 'pod/perlreguts.pod')
-rw-r--r-- | pod/perlreguts.pod | 34 |
1 files changed, 20 insertions, 14 deletions
diff --git a/pod/perlreguts.pod b/pod/perlreguts.pod index d119dfe4f2..c61a9cf793 100644 --- a/pod/perlreguts.pod +++ b/pod/perlreguts.pod @@ -987,7 +987,7 @@ than the default one. Each engine is supposed to provide access to a constant structure of the following format: typedef struct regexp_engine { - regexp* (*comp) (pTHX_ char* exp, char* xend, PMOP* pm); + regexp* (*comp) (pTHX_ char* exp, char* xend, U32 pm_flags); I32 (*exec) (pTHX_ regexp* prog, char* stringarg, char* strend, char* strbeg, I32 minend, SV* screamer, void* data, U32 flags); @@ -1022,22 +1022,28 @@ The routines are as follows: =item comp - regexp* comp(char *exp, char *xend, PMOP pm); + regexp* comp(char *exp, char *xend, U32 pm_flags); Compile the pattern between exp and xend using the flags contained in pm and return a pointer to a prepared regexp structure that can perform -the match. - -The utf8'ness of the string can be found by testing - - pm->op_pmdynflags & PMdf_CMP_UTF8 - -Additional various flags reflecting the modifiers used are contained in - - pm->op_pmflags - -some of these have exact equivelents in re->extflags. See regcomp.h and op.h -for details of these values. +the match. pm flags will have the following flag bits set as determined +by the context that comp() has been called from: + + RXf_UTF8 pattern is encoded in UTF8 + RXf_PMf_LOCALE use locale + RXf_PMf_MULTILINE /m + RXf_PMf_SINGLELINE /s + RXf_PMf_FOLD /i + RXf_PMf_EXTENDED /x + RXf_PMf_KEEPCOPY /k + RXf_SKIPWHITE split ' ' or split with no args + +In general these flags should be preserved in regex->extflags after +compilation, although it is possible the regex includes constructs that +changes them. The perl engine for instance may upgrade non-utf8 strings +to utf8 if the pattern includes constructs such as C<\x{...}> that can only +match unicode values. RXf_SKIPWHITE should always be preserved verbatim +in regex->extflags. =item exec |