diff options
author | Ilya Zakharevich <ilya@math.berkeley.edu> | 1999-10-24 19:47:45 -0400 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 1999-10-25 08:16:55 +0000 |
commit | b3c9acc1dea37c675a57f40a88b0c08196d48123 (patch) | |
tree | 3229f54df3315be26126f1623226d990ccb05dcc /regexec.c | |
parent | c82a54e6a750dc8a367ca819b48d5f3b6210486f (diff) | |
download | perl-b3c9acc1dea37c675a57f40a88b0c08196d48123.tar.gz |
Missing REx engine patch
To: perl5-porters@perl.org (Mailing list Perl5)
Message-Id: <199910250347.XAA16094@monk.mps.ohio-state.edu>
p4raw-id: //depot/cfgperl@4452
Diffstat (limited to 'regexec.c')
-rw-r--r-- | regexec.c | 45 |
1 files changed, 45 insertions, 0 deletions
@@ -918,6 +918,11 @@ Perl_regexec_flags(pTHX_ register regexp *prog, char *stringarg, register char * else if (c = prog->regstclass) { I32 doevery = (prog->reganch & ROPT_SKIP) == 0; char *cc; + char *m; + int ln; + int c1; + int c2; + char *e; if (minlen) dontbother = minlen - 1; @@ -953,6 +958,43 @@ Perl_regexec_flags(pTHX_ register regexp *prog, char *stringarg, register char * s++; } break; + case EXACTF: + m = STRING(c); + ln = STR_LEN(c); + c1 = *m; + c2 = PL_fold[c1]; + goto do_exactf; + case EXACTFL: + m = STRING(c); + ln = STR_LEN(c); + c1 = *m; + c2 = PL_fold_locale[c1]; + do_exactf: + e = strend - ln; + + /* Here it is NOT UTF! */ + if (c1 == c2) { + while (s <= e) { + if ( *s == c1 + && (ln == 1 || (OP(c) == EXACTF + ? ibcmp(s, m, ln) + : ibcmp_locale(s, m, ln))) + && regtry(prog, s) ) + goto got_it; + s++; + } + } else { + while (s <= e) { + if ( (*s == c1 || *s == c2) + && (ln == 1 || (OP(c) == EXACTF + ? ibcmp(s, m, ln) + : ibcmp_locale(s, m, ln))) + && regtry(prog, s) ) + goto got_it; + s++; + } + } + break; case BOUNDL: PL_reg_flags |= RF_tainted; /* FALL THROUGH */ @@ -1364,6 +1406,9 @@ Perl_regexec_flags(pTHX_ register regexp *prog, char *stringarg, register char * s += UTF8SKIP(s); } break; + default: + croak("panic: unknown regstclass %d", (int)OP(c)); + break; } } else { |