VirtualBox

source: kBuild/vendor/sed/current/testsuite/uniq.inp

Last change on this file was 599, checked in by bird, 18 years ago

GNU sed 4.1.5.

File size: 48.5 KB
Line 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330#define DPRINTF(p) /*nothing */
331#define DPRINTF(p) printf p
332#define GETCHAR(c, eptr) c = *eptr;
333#define GETCHARINC(c, eptr) c = *eptr++;
334#define class pcre_class
335#define match_condassert 0x01 /* Called to check a condition assertion */
336#define match_isgroup 0x02 /* Set if start of bracketed group */
337#else
338#endif
339#endif
340#endif
341#endif
342#endif
343#endif
344#endif
345#endif
346#endif
347#endif
348#endif
349#endif
350#endif
351#endif
352#endif
353#endif
354#ifdef DEBUG /* Sigh. Some compilers never learn. */
355#ifdef DEBUG /* Sigh. Some compilers never learn. */
356#ifdef DEBUG
357#ifdef DEBUG
358#ifdef DEBUG
359#ifdef DEBUG
360#ifdef DEBUG
361#ifdef DEBUG
362#ifdef DEBUG
363#ifdef DEBUG
364#ifdef DEBUG
365#ifdef DEBUG
366#ifdef DEBUG
367#ifdef DEBUG
368#ifdef DEBUG
369#ifdef __cplusplus
370#include "internal.h"
371&& length - re->max_match_size > start_offset)
372((*ecode++ == OP_BEG_WORD) ? prev_is_word : cur_is_word))
373((md->ctypes[*eptr] & ctype_word) != 0);
374((md->ctypes[*eptr] & ctype_word) != 0);
375((md->ctypes[eptr[-1]] & ctype_word) != 0);
376((md->ctypes[eptr[-1]] & ctype_word) != 0);
377(eptr == md->end_subject - 1 && *eptr != '\n'))
378(eptr == md->end_subject - 1 && *eptr != '\n'))
379(i.e. keep it out of the loop). Also we can test that there are at least
380(md->ctypes[*eptr++] & ctype_digit) != 0)
381(md->ctypes[*eptr++] & ctype_digit) == 0)
382(md->ctypes[*eptr++] & ctype_space) != 0)
383(md->ctypes[*eptr++] & ctype_space) == 0)
384(md->ctypes[*eptr++] & ctype_word) != 0)
385(md->ctypes[*eptr++] & ctype_word) == 0)
386(offsetcount - 2) * sizeof (int));
387(offsets == NULL && offsetcount > 0))
388(pcre_free) (match_block.offset_vector);
389(pcre_free) (match_block.offset_vector);
390(pcre_free) (save);
391(re->tables + fcc_offset)[req_char] : req_char;
392* Match a back-reference *
393* Execute a Regular Expression *
394* Match from current position *
395* Debugging function to print chars *
396* Perl-Compatible Regular Expressions *
397* Macros and tables for character handling *
398*************************************************/
399*************************************************/
400*************************************************/
401*************************************************/
402*************************************************/
403*************************************************/
404*/
405*/
406*/
407*/
408*/
409*iptr = -1;
410*iptr++ = -1;
411*prev == OP_ASSERTBACK || *prev == OP_ASSERTBACK_NOT ||
412*prev == OP_ONCE)
413-----------------------------------------------------------------------------
414-----------------------------------------------------------------------------
415-1 => failed to match
416/*
417/* "Once" brackets are like assertion brackets except that after a match,
418/* ... else fall through */
419/* ... else fall through */
420/* Advance to a possible match for an initial string after study */
421/* Allow compilation as C++ source code, should anybody want to do that. */
422/* Always fail if not enough characters left */
423/* An alternation is the end of a branch; scan along to find the end of the
424/* Assert before internal newline if multiline, or before a terminating
425/* Assertion brackets. Check the alternative branches in turn - the
426/* At the start of a bracketed group, add the current subject pointer to the
427/* BRAZERO and BRAMINZERO occur just before a bracket group, indicating
428/* Caseful comparisons */
429/* Caseful comparisons */
430/* Change option settings */
431/* Common code for all repeated single character type matches */
432/* Common code for all repeated single-character matches. We can give
433/* Common code for all repeated single-character matches. We can give
434/* Compute the minimum number of offsets that we need to reset each time. Doing
435/* Conditional group: compilation checked that there are no more than
436/* Continue as from after the assertion, updating the offsets high water
437/* Continue from after the assertion, updating the offsets high water
438/* Control never gets here */
439/* Control never gets here */
440/* Control never gets here */
441/* Control never gets here */
442/* Control never gets here */
443/* Control never gets here */
444/* Control never gets here */
445/* Control never gets here */
446/* Control never gets here */
447/* Control never gets here */
448/* Control never gets here */
449/* Control never gets here */
450/* Control never gets here */
451/* Control never gets here */
452/* Control never reaches here */
453/* Control never reaches here */
454/* Copy the offset information from temporary store if necessary */
455/* Do a single test if no case difference is set up */
456/* Do not stick any code in here without much thought; it is assumed
457/* End of a group, repeated or non-repeating. If we are at the end of
458/* End of subject assertion (\z) */
459/* End of subject or ending \n assertion (\Z) */
460/* End of the pattern. If PCRE_NOTEMPTY is set, fail if we have matched
461/* First, ensure the minimum number of matches are present. */
462/* First, ensure the minimum number of matches are present. Use inline
463/* First, ensure the minimum number of matches are present. We get back
464/* Flag bits for the match() function */
465/* For a non-repeating ket, just continue at this level. This also
466/* For a non-repeating ket, just continue at this level. This also
467/* For anchored or unanchored matches, there may be a "last known required
468/* For extended extraction brackets (large number), we have to fish out
469/* For extended extraction brackets (large number), we have to fish out the
470/* For matches anchored to the end of the pattern, we can often avoid
471/* If a back reference hasn't been set, the length that is passed is greater
472/* If checking an assertion for a condition, return TRUE. */
473/* If hit the end of the group (which could be repeated), fail */
474/* If max == min we can continue with the main loop without the
475/* If maximizing it is worth using inline code for speed, doing the type
476/* If maximizing, find the longest possible run, then work backwards. */
477/* If maximizing, find the longest string and work backwards */
478/* If min = max, continue at the same level without recursing */
479/* If min = max, continue at the same level without recursion.
480/* If minimizing, keep testing the rest of the expression and advancing
481/* If minimizing, keep trying and advancing the pointer */
482/* If minimizing, we have to test the rest of the pattern before each
483/* If req_char is set, we know that that character must appear in the subject
484/* If the expression has got more back references than the offsets supplied can
485/* If the length of the reference is zero, just continue with the
486/* If the reference is unset, set the length to be longer than the amount
487/* If we can't find the required character, break the matching loop */
488/* If we have found the required character, save the point where we
489/* In all other cases except a conditional group we have to check the
490/* In case the recursion has set more capturing values, save the final
491/* Include the internals header, which itself includes Standard C headers plus
492/* Insufficient room for saving captured contents */
493/* Loop for handling unanchored repeated matching attempts; for anchored regexs
494/* Match a back reference, possibly repeatedly. Look past the end of the
495/* Match a character class, possibly repeatedly. Look past the end of the
496/* Match a negated single character */
497/* Match a negated single character repeatedly. This is almost a repeat of
498/* Match a run of characters */
499/* Match a single character repeatedly; different opcodes share code. */
500/* Match a single character type repeatedly; several different opcodes
501/* Match a single character type; inline for speed */
502/* Min and max values for the common repeats; for the maxima, 0 => infinity */
503/* Move the subject pointer back. This occurs only at the start of
504/* Negative assertion: all branches must fail to match */
505/* Now start processing the operations. */
506/* OP_KETRMAX */
507/* OP_KETRMAX */
508/* On entry ecode points to the first opcode, and eptr to the first character
509/* Opening capturing bracket. If there is space in the offset vector, save
510/* Or to a non-unique first char after study */
511/* Or to a unique first char if possible */
512/* Or to just after \n for a multiline match if possible */
513/* Other types of node can be handled by a switch */
514/* Otherwise test for either case */
515/* Print a sequence of chars in printable format, stopping at the end of the
516/* Recursion matches the current regex, nested. If there are any capturing
517/* Reset the maximum number of extractions we might see. */
518/* Reset the value of the ims flags, in case they got changed during
519/* Reset the working variable associated with each extraction. These should
520/* Separate the caselesss case for speed */
521/* Set up for repetition, or handle the non-repeated case */
522/* Set up the first character to match, if available. The first_char value is
523/* Skip over conditional reference data or large extraction number data if
524/* Start of subject assertion */
525/* Start of subject unless notbol, or after internal newline if multiline */
526/* Structure for building a chain of data that actually lives on the
527/* The code is duplicated for the caseless and caseful cases, for speed,
528/* The code is duplicated for the caseless and caseful cases, for speed,
529/* The condition is an assertion. Call match() to evaluate it - setting
530/* The ims options can vary during the matching as a result of the presence
531/* The repeating kets try the rest of the pattern or restart from the
532/* The repeating kets try the rest of the pattern or restart from the
533/* There's been some horrible disaster. */
534/* This "while" is the end of the "do" above */
535/* This function applies a compiled re to a subject string and picks out
536/* Use a macro for debugging printing, 'cause that limits the use of #ifdef
537/* We don't need to repeat the search if we haven't yet reached the
538/* When a match occurs, substrings will be set for all internal extractions;
539/* Word boundary assertions */
540/*************************************************
541/*************************************************
542/*************************************************
543/*************************************************
544/*************************************************
545/*************************************************
5461. This software is distributed in the hope that it will be useful,
5472. The origin of this software must not be misrepresented, either by
5483. Altered versions must be plainly marked as such, and must not be
5494. If PCRE is embedded in any software that is released under the GNU
5505.005. If there is an options reset, it will get obeyed in the normal
5515.005. If there is an options reset, it will get obeyed in the normal
5526 : 3 + (ecode[1] << 8) + ecode[2]),
553< -1 => some kind of unexpected problem
554= 0 => success, but offsets is not big enough
555Arguments:
556Arguments:
557Arguments:
558Arguments:
559BOOL anchored;
560BOOL cur_is_word = (eptr < md->end_subject) &&
561BOOL cur_is_word = (eptr < md->end_subject) &&
562BOOL is_subject;
563BOOL minimize = FALSE;
564BOOL prev_is_word = (eptr != md->start_subject) &&
565BOOL prev_is_word = (eptr != md->start_subject) &&
566BOOL rc;
567BOOL startline;
568BOOL using_temporary_offsets = FALSE;
569Copyright (c) 1997-2000 University of Cambridge
570DPRINTF ((">>>> returning %d\n", match_block.errorcode));
571DPRINTF ((">>>> returning %d\n", rc));
572DPRINTF (("Copied offsets from temporary memory\n"));
573DPRINTF (("Freeing temporary memory\n"));
574DPRINTF (("Freeing temporary memory\n"));
575DPRINTF (("Got memory to hold back references\n"));
576DPRINTF (("Unknown opcode %d\n", *ecode));
577DPRINTF (("bracket %d failed\n", number));
578DPRINTF (("bracket 0 failed\n"));
579DPRINTF (("ims reset to %02lx\n", ims));
580DPRINTF (("ims set to %02lx at group repeat\n", ims));
581DPRINTF (("ims set to %02lx\n", ims));
582DPRINTF (("matching %c{%d,%d} against subject %.*s\n", c, min, max,
583DPRINTF (("negative matching %c{%d,%d} against subject %.*s\n", c, min, max,
584DPRINTF (("saving %d %d %d\n", save_offset1, save_offset2, save_offset3));
585DPRINTF (("start bracket 0\n"));
586GETCHAR (c, eptr) /* Get character */
587GETCHARINC (c, eptr) /* Get character; increment eptr */
588GETCHARINC (c, eptr) /* Get character; increment eptr */
589General Purpose Licence (GPL), then the terms of that licence shall
590However, if the referenced string is the empty string, always treat
591If the bracket fails to match, we need to restore this value and also the
592If there isn't enough space in the offset vector, treat this as if it were a
593MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
594Otherwise, we can use the vector supplied, rounding down its size to a multiple
595Permission is granted to anyone to use this software for any purpose on any
596REPEATCHAR:
597REPEATNOTCHAR:
598REPEATTYPE:
599Returns: > 0 => success; value is the number of elements filled in
600Returns: TRUE if matched
601Returns: TRUE if matched
602Returns: nothing
603They are not both allowed to be zero. */
604This is a library of functions to support regular expressions whose syntax
605This is the forcible breaking of infinite loops as implemented in Perl
606This is the forcible breaking of infinite loops as implemented in Perl
607Writing separate code makes it go faster, as does using an autoincrement and
608Written by: Philip Hazel <ph10@cam.ac.uk>
609a move back into the brackets. Check the alternative branches in turn - the
610address of eptr, so that eptr can be a register variable. */
611an assertion "group", stop matching and return TRUE, but record the
612an empty string - recursion will then try other alternatives, if any. */
613an error. Save the top 15 values on the stack, and accept that the rest
614an unanchored pattern, of course. If there's no first char and the pattern was
615analyzing most of the pattern. length > re->max_match_size is
616anchored = ((re->options | options) & PCRE_ANCHORED) != 0;
617and advance one byte in the pattern code. */
618and reinstate them after the recursion. However, we don't know how many
619and semantics are as close as possible to those of the Perl 5 language. See
620and the required character in fact is caseful. */
621at run time, so we have to test for anchoring. The first char may be unset for
622avoid duplicate testing (which takes significant time). This covers the vast
623backing off on a match. */
624bmtable = extra->data.bmtable;
625both cases of the character. Otherwise set the two values the same, which will
626bracketed group and go to there. */
627brackets - for testing for empty matches
628brackets started but not finished, we have to save their starting points
629break;
630break;
631break;
632break;
633break;
634break;
635break;
636break;
637break;
638break;
639break;
640break;
641break;
642break;
643break;
644break;
645break;
646break;
647break;
648break;
649break;
650break;
651break;
652break;
653break;
654break;
655break;
656break;
657break;
658break;
659break;
660break;
661break;
662break;
663break;
664break;
665break;
666break;
667break;
668break;
669break;
670break;
671break;
672break;
673break;
674break;
675break;
676break;
677break;
678break;
679break;
680break;
681break;
682break;
683break;
684break;
685break;
686break;
687break;
688break;
689break;
690break;
691break;
692break;
693break;
694break;
695break;
696break;
697break;
698break;
699break;
700break;
701break;
702but WITHOUT ANY WARRANTY; without even the implied warranty of
703c != md->lcc[*eptr++])
704c = *ecode++ - OP_CRSTAR;
705c = *ecode++ - OP_CRSTAR;
706c = *ecode++ - OP_NOTSTAR;
707c = *ecode++ - OP_STAR;
708c = *ecode++ - OP_TYPESTAR;
709c = *ecode++;
710c = *ecode++;
711c = *eptr++;
712c = 15;
713c = max - min;
714c = md->end_subject - eptr;
715c = md->lcc[c];
716c = md->lcc[c];
717c = md->offset_max;
718c == md->lcc[*eptr++])
719can't just fail here, because of the possibility of quantifiers with zero
720case OP_ALT:
721case OP_ANY:
722case OP_ANY:
723case OP_ANY:
724case OP_ANY:
725case OP_ASSERT:
726case OP_ASSERTBACK:
727case OP_ASSERTBACK_NOT:
728case OP_ASSERT_NOT:
729case OP_BEG_WORD:
730case OP_BRA: /* Non-capturing bracket: optimized */
731case OP_BRAMINZERO:
732case OP_BRANUMBER:
733case OP_BRAZERO:
734case OP_CHARS:
735case OP_CIRC:
736case OP_CLASS:
737case OP_COND:
738case OP_CREF:
739case OP_CRMINPLUS:
740case OP_CRMINPLUS:
741case OP_CRMINQUERY:
742case OP_CRMINQUERY:
743case OP_CRMINRANGE:
744case OP_CRMINRANGE:
745case OP_CRMINSTAR:
746case OP_CRMINSTAR:
747case OP_CRPLUS:
748case OP_CRPLUS:
749case OP_CRQUERY:
750case OP_CRQUERY:
751case OP_CRRANGE:
752case OP_CRRANGE:
753case OP_CRSTAR:
754case OP_CRSTAR:
755case OP_DIGIT:
756case OP_DIGIT:
757case OP_DIGIT:
758case OP_DIGIT:
759case OP_DOLL:
760case OP_END:
761case OP_END_WORD:
762case OP_EOD:
763case OP_EODN:
764case OP_EXACT:
765case OP_KET:
766case OP_KETRMAX:
767case OP_KETRMIN:
768case OP_MINPLUS:
769case OP_MINQUERY:
770case OP_MINSTAR:
771case OP_MINUPTO:
772case OP_NOT:
773case OP_NOTEXACT:
774case OP_NOTMINPLUS:
775case OP_NOTMINQUERY:
776case OP_NOTMINSTAR:
777case OP_NOTMINUPTO:
778case OP_NOTPLUS:
779case OP_NOTQUERY:
780case OP_NOTSTAR:
781case OP_NOTUPTO:
782case OP_NOT_DIGIT:
783case OP_NOT_DIGIT:
784case OP_NOT_DIGIT:
785case OP_NOT_DIGIT:
786case OP_NOT_WHITESPACE:
787case OP_NOT_WHITESPACE:
788case OP_NOT_WHITESPACE:
789case OP_NOT_WHITESPACE:
790case OP_NOT_WORDCHAR:
791case OP_NOT_WORDCHAR:
792case OP_NOT_WORDCHAR:
793case OP_NOT_WORDCHAR:
794case OP_NOT_WORD_BOUNDARY:
795case OP_ONCE:
796case OP_OPT:
797case OP_PLUS:
798case OP_QUERY:
799case OP_RECURSE:
800case OP_REF:
801case OP_REVERSE:
802case OP_SOD:
803case OP_STAR:
804case OP_TYPEEXACT:
805case OP_TYPEMINPLUS:
806case OP_TYPEMINQUERY:
807case OP_TYPEMINSTAR:
808case OP_TYPEMINUPTO:
809case OP_TYPEPLUS:
810case OP_TYPEQUERY:
811case OP_TYPESTAR:
812case OP_TYPEUPTO:
813case OP_UPTO:
814case OP_WHITESPACE:
815case OP_WHITESPACE:
816case OP_WHITESPACE:
817case OP_WHITESPACE:
818case OP_WORDCHAR:
819case OP_WORDCHAR:
820case OP_WORDCHAR:
821case OP_WORDCHAR:
822case OP_WORD_BOUNDARY:
823case matching may be when this character is hit, so test for it in both its
824caselessly, or if there are any changes of this flag within the regex, set up
825cases if necessary. However, the different cased versions will not be set up
826character" set. If the PCRE_CASELESS is set, implying that the match starts
827characters and work backwards. */
828characters and work backwards. */
829code for maximizing the speed, and do the type test once at the start
830code to character type repeats - written out again for speed. */
831commoning these up that doesn't require a test of the positive/negative
832computer system, and to redistribute it freely, subject to the following
833const char *subject;
834const pcre *re;
835const pcre_extra *extra;
836const uschar *bmtable = NULL;
837const uschar *data = ecode + 1; /* Save for matching */
838const uschar *end_subject;
839const uschar *next = ecode + 1;
840const uschar *next = ecode + 1;
841const uschar *p = md->start_subject + md->offset_vector[offset];
842const uschar *p;
843const uschar *pp = eptr;
844const uschar *pp = eptr;
845const uschar *pp = eptr;
846const uschar *pp = eptr;
847const uschar *pp = eptr;
848const uschar *pp = eptr;
849const uschar *pp = eptr;
850const uschar *prev = ecode - (ecode[1] << 8) - ecode[2];
851const uschar *prev = ecode;
852const uschar *req_char_ptr = start_match - 1;
853const uschar *saved_eptr = eptr;
854const uschar *saved_eptr = eptrb->saved_eptr;
855const uschar *saved_eptr;
856const uschar *start_bits = NULL;
857const uschar *start_match = (const uschar *) subject + start_offset;
858continue; /* With the main loop */
859continue;
860continue;
861continue;
862continue;
863continue;
864continue;
865continue;
866continue;
867continue;
868continue;
869continue;
870continue;
871continue;
872course of events. */
873course of events. */
874ctype = *ecode++; /* Code for the character type */
875cur_is_word == prev_is_word : cur_is_word != prev_is_word)
876current high water mark for use by positive assertions. Do this also
877default: /* No repeat follows */
878default: /* No repeat follows */
879default:
880do
881do
882do
883do
884do
885do
886do
887do
888do
889do
890do
891each branch of a lookbehind assertion. If we are too close to the start to
892each substring: the offsets to the start and end of the substring.
893ecode position in code
894ecode + ((offset < offset_top && md->offset_vector[offset] >= 0) ?
895ecode += (ecode[1] << 8) + ecode[2];
896ecode += (ecode[1] << 8) + ecode[2];
897ecode += (ecode[1] << 8) + ecode[2];
898ecode += (ecode[1] << 8) + ecode[2];
899ecode += (ecode[1] << 8) + ecode[2];
900ecode += (ecode[1] << 8) + ecode[2];
901ecode += (ecode[1] << 8) + ecode[2];
902ecode += (ecode[1] << 8) + ecode[2];
903ecode += (ecode[1] << 8) + ecode[2];
904ecode += (ecode[1] << 8) + ecode[2];
905ecode += 2;
906ecode += 2;
907ecode += 3 + (ecode[4] << 8) + ecode[5];
908ecode += 33; /* Advance past the item */
909ecode += 3; /* Advance past the item */
910ecode += 3;
911ecode += 3;
912ecode += 3;
913ecode += 3;
914ecode += 3;
915ecode += 3;
916ecode += 3;
917ecode += 3;
918ecode += 3;
919ecode += 3;
920ecode += 3;
921ecode += 3;
922ecode += 5;
923ecode += 5;
924ecode = next + 3;
925ecode++;
926ecode++;
927ecode++;
928ecode++;
929ecode++;
930ecode++;
931ecode++;
932ecode++;
933ecode++;
934ecode++;
935ecode++;
936ecode++;
937ecode++;
938ecode++;
939ecode++;
940ecode++;
941else
942else
943else
944else
945else
946else
947else
948else
949else
950else
951else
952else
953else
954else
955else
956else
957else
958else
959else
960else
961else
962else
963else
964else
965else
966else
967else
968else
969else
970else
971else
972else
973else if ((extra->options & PCRE_STUDY_BM) != 0)
974else if (first_char >= 0)
975else if (start_bits != NULL)
976else if (startline)
977encountered */
978end_subject = match_block.end_subject;
979eptr pointer in subject
980eptr points into the subject
981eptr += c;
982eptr += length;
983eptr += length;
984eptr += length;
985eptr += length;
986eptr += min;
987eptr -= (ecode[1] << 8) + ecode[2];
988eptr -= length;
989eptr = md->end_match_ptr;
990eptr = md->end_match_ptr;
991eptr++;
992eptr++;
993eptr++;
994eptr++;
995eptr++;
996eptr++;
997eptr++;
998eptr++;
999eptr++;
1000eptr++;
1001eptr++;
1002eptr++;
1003eptrb pointer to chain of blocks containing eptr at start of
1004eptrb = &newptrb;
1005eptrb = eptrb->prev; /* Back up the stack of bracket start pointers */
1006eptrblock *eptrb;
1007eptrblock newptrb;
1008eptrblock;
1009exactly what going to the ket would do. */
1010explicit claim or by omission.
1011external_extra points to "hints" from pcre_study() or is NULL
1012external_re points to the compiled expression
1013extraction by setting the offsets and bumping the high water mark. */
1014first_char = match_block.lcc[first_char];
1015first_char = re->first_char;
1016flags can contain
1017for (;;)
1018for (i = 1; i <= c; i++)
1019for (i = 1; i <= c; i++)
1020for (i = 1; i <= min; i++)
1021for (i = 1; i <= min; i++)
1022for (i = 1; i <= min; i++)
1023for (i = 1; i <= min; i++)
1024for (i = 1; i <= min; i++)
1025for (i = 1; i <= min; i++)
1026for (i = 1; i <= min; i++)
1027for (i = 1; i <= min; i++)
1028for (i = 1; i <= min; i++)
1029for (i = 1; i <= min; i++)
1030for (i = 1; i <= min; i++)
1031for (i = 1; i <= min; i++)
1032for (i = 1; i <= min; i++)
1033for (i = min; i < max; i++)
1034for (i = min; i < max; i++)
1035for (i = min; i < max; i++)
1036for (i = min; i < max; i++)
1037for (i = min; i < max; i++)
1038for (i = min; i < max; i++)
1039for (i = min; i < max; i++)
1040for (i = min; i < max; i++)
1041for (i = min; i < max; i++)
1042for (i = min; i < max; i++)
1043for (i = min; i < max; i++)
1044for (i = min; i < max; i++)
1045for (i = min; i < max; i++)
1046for (i = min;; i++)
1047for (i = min;; i++)
1048for (i = min;; i++)
1049for (i = min;; i++)
1050for (i = min;; i++)
1051for (i = min;; i++)
1052for (i = min;; i++)
1053for the "once" (not-backup up) groups. */
1054for the match to succeed. If the first character is set, req_char must be
1055found it, so that we don't search again next time round the loop if
1056from a previous iteration of this group, and be referred to by a reference
1057goto REPEATCHAR;
1058goto REPEATCHAR;
1059goto REPEATNOTCHAR;
1060goto REPEATNOTCHAR;
1061goto REPEATTYPE;
1062goto REPEATTYPE;
1063group number back at the start and if necessary complete handling an
1064happens for a repeating ket if no characters were matched in the group.
1065happens for a repeating ket if no characters were matched in the group.
1066here; that is handled in the code for KET. */
1067hold, we get a temporary bit of working store to use during the matching.
1068i.e. it could be ()* or ()? in the pattern. Brackets with fixed upper
1069if (!anchored)
1070if (!match (start_match, re->code, 2, &match_block, ims, NULL, match_isgroup))
1071if (!match_ref (offset, eptr, length, md, ims))
1072if (!match_ref (offset, eptr, length, md, ims))
1073if (!match_ref (offset, eptr, length, md, ims))
1074if (!md->endonly)
1075if (!rc)
1076if (!startline && extra != NULL)
1077if ((*ecode++ == OP_WORD_BOUNDARY) ?
1078if ((data[c / 8] & (1 << (c & 7))) != 0)
1079if ((data[c / 8] & (1 << (c & 7))) != 0)
1080if ((data[c / 8] & (1 << (c & 7))) == 0)
1081if ((extra->options & PCRE_STUDY_MAPPED) != 0)
1082if ((flags & match_condassert) != 0)
1083if ((flags & match_condassert) != 0)
1084if ((flags & match_isgroup) != 0)
1085if ((ims & PCRE_CASELESS) != 0)
1086if ((ims & PCRE_CASELESS) != 0)
1087if ((ims & PCRE_CASELESS) != 0)
1088if ((ims & PCRE_CASELESS) != 0)
1089if ((ims & PCRE_CASELESS) != 0)
1090if ((ims & PCRE_CASELESS) != 0)
1091if ((ims & PCRE_CASELESS) != 0)
1092if ((ims & PCRE_DOTALL) == 0 && c == '\n')
1093if ((ims & PCRE_DOTALL) == 0 && eptr < md->end_subject && *eptr == '\n')
1094if ((ims & PCRE_DOTALL) == 0)
1095if ((ims & PCRE_DOTALL) == 0)
1096if ((ims & PCRE_MULTILINE) != 0)
1097if ((ims & PCRE_MULTILINE) != 0)
1098if ((md->ctypes[*eptr++] & ctype_digit) != 0)
1099if ((md->ctypes[*eptr++] & ctype_digit) == 0)
1100if ((md->ctypes[*eptr++] & ctype_space) != 0)
1101if ((md->ctypes[*eptr++] & ctype_space) == 0)
1102if ((md->ctypes[*eptr++] & ctype_word) != 0)
1103if ((md->ctypes[*eptr++] & ctype_word) == 0)
1104if ((md->ctypes[c] & ctype_digit) != 0)
1105if ((md->ctypes[c] & ctype_digit) == 0)
1106if ((md->ctypes[c] & ctype_space) != 0)
1107if ((md->ctypes[c] & ctype_space) == 0)
1108if ((md->ctypes[c] & ctype_word) != 0)
1109if ((md->ctypes[c] & ctype_word) == 0)
1110if ((options & ~PUBLIC_EXEC_OPTIONS) != 0)
1111if ((re->options & PCRE_FIRSTSET) != 0)
1112if ((re->options & PCRE_REQCHSET) != 0)
1113if ((start_bits[c / 8] & (1 << (c & 7))) == 0)
1114if (*ecode != OP_ONCE && *ecode != OP_ALT)
1115if (*ecode == OP_KET || eptr == saved_eptr)
1116if (*ecode == OP_KET || eptr == saved_eptr)
1117if (*ecode == OP_KET)
1118if (*ecode == OP_KETRMIN)
1119if (*ecode == OP_KETRMIN)
1120if (*ecode++ != *eptr++)
1121if (*ecode++ == *eptr++)
1122if (*eptr != '\n')
1123if (*eptr++ == '\n')
1124if (*p++ != *eptr++)
1125if (*p++ == req_char)
1126if (*prev != OP_COND)
1127if (*prev == OP_ASSERT || *prev == OP_ASSERT_NOT ||
1128if (bmtable != NULL)
1129if (bmtable[*start_match])
1130if (c != *eptr++)
1131if (c != md->lcc[*eptr++])
1132if (c < 16)
1133if (c == *eptr++)
1134if (c == md->lcc[*eptr++])
1135if (c > md->end_subject - eptr)
1136if (cur_is_word == prev_is_word ||
1137if (ecode[3] == OP_CREF) /* Condition is extraction test */
1138if (ecode[3] == OP_OPT)
1139if (eptr != md->start_subject && eptr[-1] != '\n')
1140if (eptr != md->start_subject)
1141if (eptr < md->end_subject - 1 ||
1142if (eptr < md->end_subject - 1 ||
1143if (eptr < md->end_subject)
1144if (eptr < md->end_subject)
1145if (eptr < md->start_subject)
1146if (eptr >= md->end_subject ||
1147if (eptr >= md->end_subject ||
1148if (eptr >= md->end_subject ||
1149if (eptr >= md->end_subject ||
1150if (eptr >= md->end_subject ||
1151if (eptr >= md->end_subject ||
1152if (eptr >= md->end_subject || (md->ctypes[*eptr] & ctype_digit) != 0)
1153if (eptr >= md->end_subject || (md->ctypes[*eptr] & ctype_digit) == 0)
1154if (eptr >= md->end_subject || (md->ctypes[*eptr] & ctype_space) != 0)
1155if (eptr >= md->end_subject || (md->ctypes[*eptr] & ctype_space) == 0)
1156if (eptr >= md->end_subject || (md->ctypes[*eptr] & ctype_word) != 0)
1157if (eptr >= md->end_subject || (md->ctypes[*eptr] & ctype_word) == 0)
1158if (eptr >= md->end_subject || *eptr == '\n')
1159if (eptr >= md->end_subject || c != *eptr)
1160if (eptr >= md->end_subject || c != md->lcc[*eptr])
1161if (eptr >= md->end_subject || c == *eptr)
1162if (eptr >= md->end_subject || c == md->lcc[*eptr])
1163if (eptr >= md->end_subject)
1164if (eptr >= md->end_subject)
1165if (eptr >= md->end_subject)
1166if (eptr >= md->end_subject)
1167if (eptr >= md->end_subject)
1168if (eptr++ >= md->end_subject)
1169if (i >= max || !match_ref (offset, eptr, length, md, ims))
1170if (i >= max || eptr >= md->end_subject ||
1171if (i >= max || eptr >= md->end_subject ||
1172if (i >= max || eptr >= md->end_subject || c != *eptr++)
1173if (i >= max || eptr >= md->end_subject || c == *eptr++)
1174if (i >= max || eptr >= md->end_subject)
1175if (i >= max || eptr >= md->end_subject)
1176if (is_subject && length > md->end_subject - p)
1177if (isprint (c = *(p++)))
1178if (length == 0)
1179if (length > md->end_subject - eptr)
1180if (length > md->end_subject - eptr)
1181if (match (eptr, ecode + 3, offset_top, md, ims, NULL,
1182if (match (eptr, ecode + 3, offset_top, md, ims, NULL, match_isgroup))
1183if (match (eptr, ecode + 3, offset_top, md, ims, NULL, match_isgroup))
1184if (match (eptr, ecode + 3, offset_top, md, ims, eptrb, 0) ||
1185if (match (eptr, ecode + 3, offset_top, md, ims, eptrb, 0) ||
1186if (match (eptr, ecode + 3, offset_top, md, ims, eptrb, match_isgroup))
1187if (match (eptr, ecode + 3, offset_top, md, ims, eptrb, match_isgroup))
1188if (match (eptr, ecode + 3, offset_top, md, ims, eptrb, match_isgroup))
1189if (match (eptr, ecode, offset_top, md, ims, eptrb, 0))
1190if (match (eptr, ecode, offset_top, md, ims, eptrb, 0))
1191if (match (eptr, ecode, offset_top, md, ims, eptrb, 0))
1192if (match (eptr, ecode, offset_top, md, ims, eptrb, 0))
1193if (match (eptr, ecode, offset_top, md, ims, eptrb, 0))
1194if (match (eptr, ecode, offset_top, md, ims, eptrb, 0))
1195if (match (eptr, ecode, offset_top, md, ims, eptrb, 0))
1196if (match (eptr, ecode, offset_top, md, ims, eptrb, 0))
1197if (match (eptr, next + 3, offset_top, md, ims, eptrb, match_isgroup))
1198if (match (eptr, next, offset_top, md, ims, eptrb, match_isgroup))
1199if (match (eptr, prev, offset_top, md, ims, eptrb, match_isgroup) ||
1200if (match (eptr, prev, offset_top, md, ims, eptrb, match_isgroup) ||
1201if (match (eptr--, ecode, offset_top, md, ims, eptrb, 0))
1202if (match (eptr--, ecode, offset_top, md, ims, eptrb, 0))
1203if (match (eptr--, ecode, offset_top, md, ims, eptrb, 0))
1204if (match (eptr--, ecode, offset_top, md, ims, eptrb, 0))
1205if (match (eptr--, ecode, offset_top, md, ims, eptrb, 0))
1206if (match (eptr--, ecode, offset_top, md, ims, eptrb, 0))
1207if (match_block.end_offset_top > offsetcount)
1208if (match_block.offset_vector != NULL)
1209if (match_block.offset_vector == NULL)
1210if (max == 0)
1211if (max == 0)
1212if (max == 0)
1213if (max == 0)
1214if (max == 0)
1215if (max == 0)
1216if (max == 0)
1217if (md->lcc[*ecode++] != md->lcc[*eptr++])
1218if (md->lcc[*ecode++] == md->lcc[*eptr++])
1219if (md->lcc[*p++] != md->lcc[*eptr++])
1220if (md->notbol && eptr == md->start_subject)
1221if (md->notempty && eptr == md->start_match)
1222if (md->noteol)
1223if (md->noteol)
1224if (min == max)
1225if (min == max)
1226if (min == max)
1227if (min == max)
1228if (min == max)
1229if (min == max)
1230if (min == max)
1231if (min > 0)
1232if (min > md->end_subject - eptr)
1233if (min > md->end_subject - eptr)
1234if (min > md->end_subject - eptr)
1235if (minimize)
1236if (minimize)
1237if (minimize)
1238if (minimize)
1239if (minimize)
1240if (minimize)
1241if (minimize)
1242if (number > 0)
1243if (number > EXTRACT_BASIC_MAX)
1244if (number > EXTRACT_BASIC_MAX)
1245if (offset < md->offset_max)
1246if (offset >= md->offset_max)
1247if (offset_top <= offset)
1248if (offsetcount < 2)
1249if (offsetcount >= 4)
1250if (op > OP_BRA)
1251if (p > req_char_ptr)
1252if (p >= end_subject)
1253if (pp == req_char || pp == req_char2)
1254if (re == NULL || subject == NULL ||
1255if (re->magic_number != MAGIC_NUMBER)
1256if (re->max_match_size >= 0
1257if (re->top_backref > 0 && re->top_backref >= ocount / 3)
1258if (req_char == req_char2)
1259if (req_char >= 0)
1260if (resetcount > offsetcount)
1261if (save != stacksave)
1262if (save == NULL)
1263if (skipped_chars)
1264if (start_match + bmtable[256] > end_subject)
1265if (start_match > match_block.start_subject + start_offset)
1266if (using_temporary_offsets)
1267if (using_temporary_offsets)
1268if certain parts of the pattern were not used. */
1269if the malloc fails ... there is no way of returning to the top level with
1270implied in the second condition, because start_offset > 0. */
1271ims current /i, /m, and /s options
1272ims the ims flags
1273ims = (ims & ~PCRE_IMS) | ecode[4];
1274ims = ecode[1];
1275ims = original_ims;
1276ims = re->options & (PCRE_CASELESS | PCRE_MULTILINE | PCRE_DOTALL);
1277in the pattern. */
1278in the subject string, while eptrb holds the value of eptr at the start of the
1279initialize them to avoid reading uninitialized locations. */
1280inline, and there are *still* stupid compilers about that don't like indented
1281inside the group.
1282int
1283int *offsets;
1284int *save;
1285int c;
1286int first_char = -1;
1287int flags;
1288int length;
1289int length;
1290int length;
1291int length;
1292int min, max, ctype;
1293int number = *prev - OP_BRA;
1294int number = op - OP_BRA;
1295int offset = (ecode[1] << 9) | (ecode[2] << 1); /* Doubled reference number */
1296int offset = (ecode[4] << 9) | (ecode[5] << 1); /* Doubled reference number */
1297int offset;
1298int offset;
1299int offset;
1300int offset_top;
1301int offsetcount;
1302int op = (int) *ecode;
1303int options;
1304int rc;
1305int req_char = -1;
1306int req_char2 = -1;
1307int resetcount, ocount;
1308int save_offset1 = md->offset_vector[offset];
1309int save_offset2 = md->offset_vector[offset + 1];
1310int save_offset3 = md->offset_vector[md->offset_end - number];
1311int skipped_chars = 0;
1312int stacksave[15];
1313int start_offset;
1314is a bit large to put on the stack, but using malloc for small numbers
1315is_subject TRUE if printing from within md->start_subject
1316it as matched, any number of times (otherwise there could be infinite
1317item to see if there is repeat information following. The code is similar
1318item to see if there is repeat information following. Then obey similar
1319last bracketed group - used for breaking infinite loops matching zero-length
1320later in the subject; otherwise the test starts at the match point. This
1321length length of subject string (may contain binary zeros)
1322length length to be matched
1323length number to print
1324length = (offset >= offset_top || md->offset_vector[offset] < 0) ?
1325length = md->end_subject - p;
1326level without recursing. Otherwise, if minimizing, keep trying the rest of
1327level without recursing. Otherwise, if minimizing, keep trying the rest of
1328loop. */
1329loops). */
1330main loop. */
1331majority of cases. It will be suboptimal when the case flag changes in a regex
1332mark, since extracts may have been taken during the assertion. */
1333mark, since extracts may have been taken. */
1334match (eptr, ecode + 3, offset_top, md, ims, eptrb, 0))
1335match (eptr, ecode + 3, offset_top, md, ims, eptrb, 0))
1336match (eptr, ecode, offset_top, md, ims, eptrb, flags)
1337match (eptr, prev, offset_top, md, ims, eptrb, match_isgroup))
1338match (eptr, prev, offset_top, md, ims, eptrb, match_isgroup))
1339match_block.ctypes = re->tables + ctypes_offset;
1340match_block.end_subject = match_block.start_subject + length;
1341match_block.endonly = (re->options & PCRE_DOLLAR_ENDONLY) != 0;
1342match_block.errorcode = PCRE_ERROR_NOMATCH; /* Default error */
1343match_block.errorcode == PCRE_ERROR_NOMATCH &&
1344match_block.lcc = re->tables + lcc_offset;
1345match_block.lcc[*start_match] != first_char)
1346match_block.notbol = (options & PCRE_NOTBOL) != 0;
1347match_block.notempty = (options & PCRE_NOTEMPTY) != 0;
1348match_block.noteol = (options & PCRE_NOTEOL) != 0;
1349match_block.offset_end = ocount;
1350match_block.offset_max = (2 * ocount) / 3;
1351match_block.offset_overflow = FALSE;
1352match_block.offset_overflow = TRUE;
1353match_block.offset_vector = (int *) (pcre_malloc) (ocount * sizeof (int));
1354match_block.offset_vector = offsets;
1355match_block.start_match = start_match;
1356match_block.start_pattern = re->code;
1357match_block.start_subject = (const uschar *) subject;
1358match_condassert - this is an assertion condition
1359match_condassert | match_isgroup))
1360match_data *md;
1361match_data *md;
1362match_data *md;
1363match_data match_block;
1364match_isgroup - this is the start of a bracketed group
1365match_isgroup);
1366match_ref (offset, eptr, length, md, ims)
1367matches, we carry on as at the end of a normal bracket, leaving the subject
1368matching won't pass the KET for an assertion. If any one branch matches,
1369matching won't pass the KET for this kind of subpattern. If any one branch
1370max = (ecode[1] << 8) + ecode[2];
1371max = (ecode[1] << 8) + ecode[2];
1372max = (ecode[1] << 8) + ecode[2];
1373max = (ecode[3] << 8) + ecode[4];
1374max = (ecode[3] << 8) + ecode[4];
1375max = INT_MAX;
1376max = INT_MAX;
1377max = INT_MAX;
1378max = INT_MAX;
1379max = INT_MAX;
1380max = INT_MAX;
1381max = INT_MAX;
1382max = rep_max[c]; /* zero for max => infinity */
1383max = rep_max[c]; /* zero for max => infinity */
1384max = rep_max[c]; /* zero for max => infinity */
1385max = rep_max[c]; /* zero for max => infinity */
1386max = rep_max[c]; /* zero for max => infinity */
1387max, eptr));
1388max, eptr));
1389maximum. Alternatively, if maximizing, find the maximum number of
1390maximum. Alternatively, if maximizing, find the maximum number of
1391may be wrong. */
1392md pointer to "static" info for the match
1393md pointer to matching data block, if is_subject is TRUE
1394md points to match data block
1395md->end_match_ptr = eptr; /* For ONCE */
1396md->end_match_ptr = eptr; /* Record where we ended */
1397md->end_offset_top = offset_top; /* and how many extracts were taken */
1398md->end_offset_top = offset_top;
1399md->end_subject - eptr + 1 :
1400md->errorcode = PCRE_ERROR_UNKNOWN_NODE;
1401md->offset_overflow = TRUE;
1402md->offset_vector[md->offset_end - i] = save[i];
1403md->offset_vector[md->offset_end - number] = eptr - md->start_subject;
1404md->offset_vector[md->offset_end - number] = save_offset3;
1405md->offset_vector[md->offset_end - number];
1406md->offset_vector[offset + 1] - md->offset_vector[offset];
1407md->offset_vector[offset + 1] = eptr - md->start_subject;
1408md->offset_vector[offset + 1] = save_offset2;
1409md->offset_vector[offset] =
1410md->offset_vector[offset] = save_offset1;
1411memcpy (offsets + 2, match_block.offset_vector + 2,
1412min = (ecode[1] << 8) + ecode[2];
1413min = (ecode[1] << 8) + ecode[2];
1414min = 0;
1415min = 0;
1416min = 0;
1417min = max = (ecode[1] << 8) + ecode[2];
1418min = max = (ecode[1] << 8) + ecode[2];
1419min = max = (ecode[1] << 8) + ecode[2];
1420min = max = 1;
1421min = rep_min[c]; /* Pick up values from tables; */
1422min = rep_min[c]; /* Pick up values from tables; */
1423min = rep_min[c]; /* Pick up values from tables; */
1424min = rep_min[c]; /* Pick up values from tables; */
1425min = rep_min[c]; /* Pick up values from tables; */
1426minima. */
1427minimize = (*ecode == OP_CRMINRANGE);
1428minimize = (*ecode == OP_CRMINRANGE);
1429minimize = (c & 1) != 0;
1430minimize = (c & 1) != 0;
1431minimize = (c & 1) != 0;
1432minimize = (c & 1) != 0;
1433minimize = (c & 1) != 0;
1434minimize = *ecode == OP_MINUPTO;
1435minimize = *ecode == OP_NOTMINUPTO;
1436minimize = *ecode == OP_TYPEMINUPTO;
1437minimize = TRUE;
1438minimum number of matches are present. If min = max, continue at the same
1439minimum number of matches are present. If min = max, continue at the same
1440misrepresented as being the original software.
1441move back, this match function fails. */
1442mustn't change the current values of the data slot, because they may be set
1443need to recurse. */
1444never be used unless previously set, but they get saved and restored, and so we
1445never set for an anchored regular expression, but the anchoring may be forced
1446newline unless endonly is set, else end of subject unless noteol is set. */
1447newptrb.prev = eptrb;
1448newptrb.saved_eptr = eptr;
1449next += (next[1] << 8) + next[2];
1450next += (next[1] << 8) + next[2];
1451non-capturing bracket. Don't worry about setting the flag for the error case
1452number = (ecode[4] << 8) | ecode[5];
1453number = (prev[4] << 8) | prev[5];
1454number from a dummy opcode at the start. */
1455number, then move along the subject till after the recursive match,
1456ocount = offsetcount - (offsetcount % 3);
1457ocount = re->top_backref * 3 + 3;
1458of (?ims) items in the pattern. They are kept in a local variable so that
1459of 3. */
1460of subject left; this ensures that every attempt at a match fails. We
1461offset index into the offset vector
1462offset = number << 1;
1463offset = number << 1;
1464offset_top current top pointer
1465offset_top = md->end_offset_top;
1466offset_top = md->end_offset_top;
1467offset_top = md->end_offset_top;
1468offset_top = offset + 2;
1469offset_top, md, ims, eptrb, match_isgroup);
1470offsetcount the number of elements in the vector
1471offsets points to a vector of ints to be filled in with offsets
1472offsets[0] = start_match - match_block.start_subject;
1473offsets[1] = match_block.end_match_ptr - match_block.start_subject;
1474op = OP_BRA;
1475opcode. */
1476optimization can save a huge amount of backtracking in patterns with nested
1477option for each character match. Maybe that wouldn't add very much to the
1478options option bits
1479p points to characters
1480p--;
1481p--;
1482past the end if there is only one branch, but that's OK because that is
1483pchars (ecode, length, FALSE, md);
1484pchars (eptr, 16, TRUE, md);
1485pchars (eptr, length, TRUE, md);
1486pchars (eptr, length, TRUE, md);
1487pchars (p, length, FALSE, md);
1488pchars (p, length, is_subject, md)
1489pchars (start_match, end_subject - start_match, TRUE, &match_block);
1490pcre_exec (re, extra, subject, length, start_offset, options, offsets, offsetcount)
1491place we found it at last time. */
1492pointer. */
1493portions of the string if it matches. Two elements in the vector are set for
1494pre-processor statements. I suppose it's only been 10 years... */
1495preceded by BRAZERO or BRAMINZERO. */
1496preceding bracket, in the appropriate order. */
1497preceding bracket, in the appropriate order. We need to reset any options
1498printf (" against backref ");
1499printf (" against pattern ");
1500printf ("%c", c);
1501printf (">>>> Match against: ");
1502printf (">>>>> Skipped %d chars to reach first character\n",
1503printf ("\\x%02x", c);
1504printf ("\n");
1505printf ("\n");
1506printf ("\n");
1507printf ("\n");
1508printf ("\n");
1509printf ("end bracket %d", number);
1510printf ("matching subject ");
1511printf ("matching subject ");
1512printf ("matching subject <null> against pattern ");
1513printf ("matching subject <null>");
1514printf ("start bracket %d subject=", number);
1515rc = 0;
1516rc = match (eptr, md->start_pattern, offset_top, md, ims, eptrb,
1517rc = match_block.offset_overflow ? 0 : match_block.end_offset_top / 2;
1518register const uschar *ecode;
1519register const uschar *eptr;
1520register const uschar *eptr;
1521register const uschar *p = start_match + ((first_char >= 0) ? 1 : 0);
1522register int *iend = iptr + resetcount;
1523register int *iend = iptr - resetcount / 2 + 1;
1524register int *iptr = match_block.offset_vector + ocount;
1525register int *iptr = match_block.offset_vector;
1526register int c = *start_match;
1527register int c;
1528register int i;
1529register int length = ecode[1];
1530register int pp = *p++;
1531repeat it in the interests of efficiency. */
1532repeat limits are compiled as a number of copies, with the optional ones
1533req_char = re->req_char;
1534req_char2 = ((re->options & (PCRE_CASELESS | PCRE_ICHANGED)) != 0) ?
1535req_char_ptr = p;
1536resetcount = 2 + re->top_bracket * 2;
1537resetcount = ocount;
1538restoring at the exit of a group is easy. */
1539restrictions:
1540return FALSE;
1541return FALSE;
1542return FALSE;
1543return FALSE;
1544return FALSE;
1545return FALSE;
1546return FALSE;
1547return FALSE;
1548return FALSE;
1549return FALSE;
1550return FALSE;
1551return FALSE;
1552return FALSE;
1553return FALSE;
1554return FALSE;
1555return FALSE;
1556return FALSE;
1557return FALSE;
1558return FALSE;
1559return FALSE;
1560return FALSE;
1561return FALSE;
1562return FALSE;
1563return FALSE;
1564return FALSE;
1565return FALSE;
1566return FALSE;
1567return FALSE;
1568return FALSE;
1569return FALSE;
1570return FALSE;
1571return FALSE;
1572return FALSE;
1573return FALSE;
1574return FALSE;
1575return FALSE;
1576return FALSE;
1577return FALSE;
1578return FALSE;
1579return FALSE;
1580return FALSE;
1581return FALSE;
1582return FALSE;
1583return FALSE;
1584return FALSE;
1585return FALSE;
1586return FALSE;
1587return FALSE;
1588return FALSE;
1589return FALSE;
1590return FALSE;
1591return FALSE;
1592return FALSE;
1593return FALSE;
1594return FALSE;
1595return FALSE;
1596return FALSE;
1597return FALSE;
1598return FALSE;
1599return FALSE;
1600return FALSE;
1601return FALSE;
1602return FALSE;
1603return FALSE;
1604return FALSE;
1605return FALSE;
1606return FALSE;
1607return FALSE;
1608return FALSE;
1609return FALSE;
1610return FALSE;
1611return FALSE;
1612return FALSE;
1613return FALSE;
1614return FALSE;
1615return FALSE;
1616return FALSE;
1617return FALSE;
1618return FALSE;
1619return PCRE_ERROR_BADMAGIC;
1620return PCRE_ERROR_BADOPTION;
1621return PCRE_ERROR_NOMATCH;
1622return PCRE_ERROR_NOMEMORY;
1623return PCRE_ERROR_NULL;
1624return TRUE;
1625return TRUE;
1626return TRUE;
1627return TRUE;
1628return TRUE;
1629return TRUE;
1630return TRUE;
1631return TRUE;
1632return TRUE;
1633return TRUE;
1634return TRUE;
1635return TRUE;
1636return TRUE;
1637return TRUE;
1638return TRUE;
1639return TRUE;
1640return TRUE;
1641return TRUE;
1642return TRUE;
1643return TRUE;
1644return TRUE;
1645return TRUE;
1646return TRUE;
1647return TRUE;
1648return TRUE;
1649return TRUE;
1650return TRUE;
1651return match (eptr,
1652return match (eptr, ecode + 3, offset_top, md, ims, eptrb, match_isgroup);
1653return match_block.errorcode;
1654return rc;
1655save = (int *) (pcre_malloc) ((c + 1) * sizeof (int));
1656save = stacksave;
1657save = stacksave;
1658save[i] = md->offset_vector[md->offset_end - i];
1659seems expensive. As a compromise, the stack is used when there are fewer
1660share code. This is very similar to the code for single characters, but we
1661similar code to character type repeats - written out again for speed.
1662since matching characters is likely to be quite common. First, ensure the
1663since matching characters is likely to be quite common. First, ensure the
1664skipped_chars += bmtable[*start_match],
1665skipped_chars += bmtable[256] - 1;
1666skipped_chars -= bmtable[256] - 1;
1667skipped_chars);
1668skipped_chars++,
1669skipped_chars++,
1670skipped_chars++,
1671skipped_chars++,
1672stack of such pointers, to be re-instated at the end of the group when we hit
1673stack, for holding the values of the subject pointer at the start of each
1674start of each branch to move the current point backwards, so the code at
1675start_bits = extra->data.start_bits;
1676start_match += bmtable[*start_match];
1677start_match += bmtable[256] - 1;
1678start_match -= bmtable[256] - 1;
1679start_match = (const uschar *) subject + length - re->max_match_size;
1680start_match++ < end_subject);
1681start_match++;
1682start_match++;
1683start_match++;
1684start_match++;
1685start_offset where to start in the subject string
1686startline = (re->options & PCRE_STARTLINE) != 0;
1687static BOOL
1688static BOOL
1689static const char rep_max[] =
1690static const char rep_min[] =
1691static void
1692strings.
1693struct eptrblock *prev;
1694studied, there may be a bitmap of possible first characters. */
1695subject points to the subject string
1696subject if the requested.
1697subpattern - to break infinite loops. */
1698subpattern, so as to detect when an empty string has been matched by a
1699subsequent match. */
1700such there are (offset_top records the completed total) so we just have
1701supersede any condition above with which it is incompatible.
1702switch (*ecode)
1703switch (*ecode)
1704switch (ctype)
1705switch (ctype)
1706switch (ctype)
1707switch (op)
1708test once at the start (i.e. keep it out of the loop). */
1709than 16 values to store; otherwise malloc is used. A problem is what to do
1710than the number of characters left in the string, so the match fails.
1711that "continue" in the code above comes out to here to repeat the main
1712that changed within the bracket before re-running it, so check the next
1713that it may occur zero times. It may repeat infinitely, or not at all -
1714the assertion is true. Lookbehind assertions have an OP_REVERSE item at the
1715the closing ket. When match() is called in other circumstances, we don't add to
1716the code for a repeated single character, but I haven't found a nice way of
1717the current subject position in the working slot at the top of the vector. We
1718the expression and advancing one matching character if failing, up to the
1719the expression and advancing one matching character if failing, up to the
1720the external pcre header. */
1721the file Tech.Notes for some information on the internals.
1722the final argument TRUE causes it to stop at the end of an assertion. */
1723the group. */
1724the length of the reference string explicitly rather than passing the
1725the loop runs just once. */
1726the minimum number of bytes before we start. */
1727the number from a dummy opcode at the start. */
1728the point in the subject string is not moved back. Thus there can never be
1729the pointer while it matches the class. */
1730the same bracket.
1731the stack. */
1732the start hasn't passed this character yet. */
1733the subject. */
1734the subject. */
1735there were too many extractions, set the return code to zero. In the case
1736this level is identical to the lookahead case. */
1737this makes a huge difference to execution time when there aren't many brackets
1738those back references that we can. In this case there need not be overflow
1739time taken, but character matching *is* what this is all about... */
1740to save all the potential data. There may be up to 99 such values, which
1741to that for character classes, but repeated for efficiency. Then obey
1742two branches. If the condition is false, skipping the first branch takes us
1743typedef struct eptrblock
1744unless PCRE_CASELESS was given or the casing state changes within the regex.
1745unlimited repeats that aren't going to match. We don't know what the state of
1746unsigned long int ims = 0;
1747unsigned long int ims;
1748unsigned long int ims;
1749unsigned long int original_ims = ims; /* Save for resetting on ')' */
1750up quickly if there are fewer than the minimum number of characters left in
1751up quickly if there are fewer than the minimum number of characters left in
1752using_temporary_offsets = TRUE;
1753values of the final offsets, in case they were set by a previous iteration of
1754we just need to set up the whole thing as substring 0 before returning. If
1755where we had to get some local store to hold offsets for backreferences, copy
1756while (!anchored &&
1757while (*ecode == OP_ALT)
1758while (*ecode == OP_ALT);
1759while (*ecode == OP_ALT);
1760while (*ecode == OP_ALT);
1761while (*ecode == OP_ALT);
1762while (*ecode == OP_ALT);
1763while (*ecode == OP_ALT);
1764while (*ecode == OP_ALT);
1765while (*ecode == OP_ALT);
1766while (*next == OP_ALT);
1767while (*next == OP_ALT);
1768while (--iptr >= iend)
1769while (eptr >= pp)
1770while (eptr >= pp)
1771while (eptr >= pp)
1772while (eptr >= pp)
1773while (eptr >= pp)
1774while (eptr >= pp)
1775while (eptr >= pp)
1776while (iptr < iend)
1777while (length-- > 0)
1778while (length-- > 0)
1779while (length-- > 0)
1780while (length-- > 0)
1781while (length-- > 0)
1782while (p < end_subject)
1783while (p < end_subject)
1784while (start_match < end_subject &&
1785while (start_match < end_subject && *start_match != first_char)
1786while (start_match < end_subject && start_match[-1] != '\n')
1787while (start_match < end_subject)
1788while (start_match < end_subject)
1789{
1790{
1791{
1792{
1793{
1794{
1795{
1796{
1797{
1798{
1799{
1800{
1801{
1802{
1803{
1804{
1805{
1806{
1807{
1808{
1809{
1810{
1811{
1812{
1813{
1814{
1815{
1816{
1817{
1818{
1819{
1820{
1821{
1822{
1823{
1824{
1825{
1826{
1827{
1828{
1829{
1830{
1831{
1832{
1833{
1834{
1835{
1836{
1837{
1838{
1839{
1840{
1841{
1842{
1843{
1844{
1845{
1846{
1847{
1848{
1849{
1850{
1851{
1852{
1853{
1854{
1855{
1856{
1857{
1858{
1859{
1860{
1861{
1862{
1863{
1864{
1865{
1866{
1867{
1868{
1869{
1870{
1871{
1872{
1873{
1874{
1875{
1876{
1877{
1878{
1879{
1880{
1881{
1882{
1883{
1884{
1885{
1886{
1887{
1888{
1889{
1890{
1891{
1892{
1893{
1894{
1895{
1896{
1897{
1898{
1899{
1900{
1901{
1902{
1903{
1904{
1905{
1906{
1907{
1908{
1909{
1910{
1911{
1912{
1913{
1914{
1915{
1916{
1917{
1918{
1919{
1920{
1921{
1922{
1923{0, 0, 0, 0, 1, 1};
1924{0, 0, 1, 1, 0, 0};
1925} /* End of main loop */
1926}
1927}
1928}
1929}
1930}
1931}
1932}
1933}
1934}
1935}
1936}
1937}
1938}
1939}
1940}
1941}
1942}
1943}
1944}
1945}
1946}
1947}
1948}
1949}
1950}
1951}
1952}
1953}
1954}
1955}
1956}
1957}
1958}
1959}
1960}
1961}
1962}
1963}
1964}
1965}
1966}
1967}
1968}
1969}
1970}
1971}
1972}
1973}
1974}
1975}
1976}
1977}
1978}
1979}
1980}
1981}
1982}
1983}
1984}
1985}
1986}
1987}
1988}
1989}
1990}
1991}
1992}
1993}
1994}
1995}
1996}
1997}
1998}
1999}
2000}
2001}
2002}
2003}
2004}
2005}
2006}
2007}
2008}
2009}
2010}
2011}
2012}
2013}
2014}
2015}
2016}
2017}
2018}
2019}
2020}
2021}
2022}
2023}
2024}
2025}
2026}
2027}
2028}
2029}
2030}
2031}
2032}
2033}
2034}
2035}
2036}
2037}
2038}
2039}
2040}
2041}
2042}
2043}
2044}
2045}
2046}
2047}
2048}
2049}
2050}
2051}
2052}
2053}
2054}
2055}
2056}
2057}
2058}
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette