| 24 |
19-02-06 - added SearchOfs(): let PCRE use the complete string and offset |
19-02-06 - added SearchOfs(): let PCRE use the complete string and offset |
| 25 |
into the string itself |
into the string itself |
| 26 |
20-12-06 - support for version 7.0 |
20-12-06 - support for version 7.0 |
| 27 |
|
27.08.08 - support for v7.7 |
| 28 |
} |
} |
| 29 |
|
|
| 30 |
{$H+} {$DEFINE PCRE_3_7} {$DEFINE PCRE_5_0} {$DEFINE PCRE_7_0} |
{$H+} {$DEFINE PCRE_3_7} {$DEFINE PCRE_5_0} {$DEFINE PCRE_7_0} {$DEFINE PCRE_7_7} |
| 31 |
|
|
| 32 |
Unit pcregexp; |
Unit pcregexp; |
| 33 |
|
|
| 106 |
PCRE_NEWLINE_CRLF = $00300000; |
PCRE_NEWLINE_CRLF = $00300000; |
| 107 |
PCRE_NEWLINE_ANY = $00400000; |
PCRE_NEWLINE_ANY = $00400000; |
| 108 |
PCRE_NEWLINE_ANYCRLF = $00500000; |
PCRE_NEWLINE_ANYCRLF = $00500000; |
| 109 |
|
|
| 110 |
|
PCRE_NEWLINE_BITS = PCRE_NEWLINE_CR or PCRE_NEWLINE_LF or PCRE_NEWLINE_ANY; |
| 111 |
|
|
| 112 |
|
{$ENDIF} |
| 113 |
|
{$IFDEF PCRE_7_7} |
| 114 |
|
PCRE_BSR_ANYCRLF = $00800000; |
| 115 |
|
PCRE_BSR_UNICODE = $01000000; |
| 116 |
|
PCRE_JAVASCRIPT_COMPAT= $02000000; |
| 117 |
{$ENDIF} |
{$ENDIF} |
| 118 |
|
|
| 119 |
PCRE_COMPILE_ALLOWED_OPTIONS = PCRE_ANCHORED + PCRE_AUTO_CALLOUT + PCRE_CASELESS + |
PCRE_COMPILE_ALLOWED_OPTIONS = PCRE_ANCHORED + PCRE_AUTO_CALLOUT + PCRE_CASELESS + |
| 121 |
PCRE_EXTRA + PCRE_MULTILINE + PCRE_NO_AUTO_CAPTURE + |
PCRE_EXTRA + PCRE_MULTILINE + PCRE_NO_AUTO_CAPTURE + |
| 122 |
PCRE_UNGREEDY + PCRE_UTF8 + PCRE_NO_UTF8_CHECK |
PCRE_UNGREEDY + PCRE_UTF8 + PCRE_NO_UTF8_CHECK |
| 123 |
{$IFDEF PCRE_7_0} |
{$IFDEF PCRE_7_0} |
| 124 |
+ PCRE_DUPNAMES + PCRE_FIRSTLINE + PCRE_NEWLINE_CRLF |
+ PCRE_DUPNAMES + PCRE_FIRSTLINE + PCRE_NEWLINE_BITS |
| 125 |
+ PCRE_NEWLINE_ANY + PCRE_NEWLINE_CRLF |
{$ENDIF} |
| 126 |
|
{$IFDEF PCRE_7_7} |
| 127 |
|
+ PCRE_BSR_ANYCRLF + PCRE_BSR_UNICODE + PCRE_JAVASCRIPT_COMPAT |
| 128 |
{$ENDIF} |
{$ENDIF} |
| 129 |
; |
; |
| 130 |
|
|
| 131 |
PCRE_EXEC_ALLOWED_OPTIONS = PCRE_ANCHORED + PCRE_NOTBOL + PCRE_NOTEOL + |
PCRE_EXEC_ALLOWED_OPTIONS = PCRE_ANCHORED + PCRE_NOTBOL + PCRE_NOTEOL + |
| 132 |
PCRE_NOTEMPTY + PCRE_NO_UTF8_CHECK + PCRE_PARTIAL |
PCRE_NOTEMPTY + PCRE_NO_UTF8_CHECK + PCRE_PARTIAL |
| 133 |
{$IFDEF PCRE_7_0} |
{$IFDEF PCRE_7_0} |
| 134 |
+ PCRE_NEWLINE_CRLF + PCRE_NEWLINE_ANY +PCRE_NEWLINE_ANYCRLF |
+ PCRE_NEWLINE_BITS |
| 135 |
|
{$ENDIF} |
| 136 |
|
{$IFDEF PCRE_7_7} |
| 137 |
|
+ PCRE_BSR_ANYCRLF + PCRE_BSR_UNICODE |
| 138 |
{$ENDIF} |
{$ENDIF} |
| 139 |
; |
; |
| 140 |
|
|
| 142 |
PCRE_DFA_EXEC_ALLOWED_OPTIONS = PCRE_ANCHORED + PCRE_NOTBOL + PCRE_NOTEOL + |
PCRE_DFA_EXEC_ALLOWED_OPTIONS = PCRE_ANCHORED + PCRE_NOTBOL + PCRE_NOTEOL + |
| 143 |
PCRE_NOTEMPTY + PCRE_NO_UTF8_CHECK + PCRE_PARTIAL + |
PCRE_NOTEMPTY + PCRE_NO_UTF8_CHECK + PCRE_PARTIAL + |
| 144 |
PCRE_DFA_SHORTEST + PCRE_DFA_RESTART + |
PCRE_DFA_SHORTEST + PCRE_DFA_RESTART + |
| 145 |
PCRE_NEWLINE_CR + PCRE_NEWLINE_LF + PCRE_NEWLINE_CRLF + |
PCRE_NEWLINE_BITS |
| 146 |
PCRE_NEWLINE_ANY + PCRE_NEWLINE_ANYCRLF |
{$IFDEF PCRE_7_7} |
| 147 |
|
+ PCRE_BSR_ANYCRLF + PCRE_BSR_UNICODE |
| 148 |
|
{$ENDIF} |
| 149 |
|
; |
| 150 |
{$ENDIF} |
{$ENDIF} |
| 151 |
|
|
| 152 |
{ Exec-time and get/set-time error codes } |
{ Exec-time and get/set-time error codes } |
| 181 |
{ Request types for pcre_fullinfo() } |
{ Request types for pcre_fullinfo() } |
| 182 |
|
|
| 183 |
PCRE_INFO_OPTIONS = 0; |
PCRE_INFO_OPTIONS = 0; |
| 184 |
PCRE_INFO_SIZE = 1; |
PCRE_INFO_SIZE = 1; |
| 185 |
PCRE_INFO_CAPTURECOUNT = 2; |
PCRE_INFO_CAPTURECOUNT = 2; |
| 186 |
PCRE_INFO_BACKREFMAX = 3; |
PCRE_INFO_BACKREFMAX = 3; |
| 187 |
PCRE_INFO_FIRSTBYTE = 4; |
PCRE_INFO_FIRSTBYTE = 4; |
| 195 |
PCRE_INFO_STUDYSIZE = 10; |
PCRE_INFO_STUDYSIZE = 10; |
| 196 |
PCRE_INFO_DEFAULT_TABLES = 11; |
PCRE_INFO_DEFAULT_TABLES = 11; |
| 197 |
{$ENDIF PCRE_5_0} |
{$ENDIF PCRE_5_0} |
| 198 |
|
{$IFDEF PCRE_7_7} |
| 199 |
|
PCRE_INFO_OKPARTIAL = 12; |
| 200 |
|
PCRE_INFO_JCHANGED = 13; |
| 201 |
|
PCRE_INFO_HASCRORLF = 14; |
| 202 |
|
{$ENDIF} |
| 203 |
|
|
| 204 |
{ Request types for pcre_config() } |
{ Request types for pcre_config() } |
| 205 |
{$IFDEF PCRE_5_0} |
{$IFDEF PCRE_5_0} |
| 206 |
PCRE_CONFIG_UTF8 = 0; |
PCRE_CONFIG_UTF8 = 0; |
| 207 |
PCRE_CONFIG_NEWLINE = 1; |
PCRE_CONFIG_NEWLINE = 1; |
| 208 |
PCRE_CONFIG_LINK_SIZE = 2; |
PCRE_CONFIG_LINK_SIZE = 2; |
| 209 |
PCRE_CONFIG_POSIX_MALLOC_THRESHOLD = 3; |
PCRE_CONFIG_POSIX_MALLOC_THRESHOLD = 3; |
| 210 |
PCRE_CONFIG_MATCH_LIMIT = 4; |
PCRE_CONFIG_MATCH_LIMIT = 4; |
| 211 |
PCRE_CONFIG_STACKRECURSE = 5; |
PCRE_CONFIG_STACKRECURSE = 5; |
| 214 |
{$IFDEF PCRE_7_0} |
{$IFDEF PCRE_7_0} |
| 215 |
PCRE_CONFIG_MATCH_LIMIT_RECURSION = 7; |
PCRE_CONFIG_MATCH_LIMIT_RECURSION = 7; |
| 216 |
{$ENDIF} |
{$ENDIF} |
| 217 |
|
{$IFDEF PCRE_7_7} |
| 218 |
|
PCRE_CONFIG_BSR = 8; |
| 219 |
|
{$ENDIF} |
| 220 |
|
|
| 221 |
{ Bit flags for the pcre_extra structure } |
{ Bit flags for the pcre_extra structure } |
| 222 |
{$IFDEF PCRE_5_0} |
{$IFDEF PCRE_5_0} |
| 223 |
PCRE_EXTRA_STUDY_DATA = $0001; |
PCRE_EXTRA_STUDY_DATA = $0001; |
| 224 |
PCRE_EXTRA_MATCH_LIMIT = $0002; |
PCRE_EXTRA_MATCH_LIMIT = $0002; |
| 225 |
PCRE_EXTRA_CALLOUT_DATA = $0004; |
PCRE_EXTRA_CALLOUT_DATA = $0004; |
| 226 |
PCRE_EXTRA_TABLES = $0008; |
PCRE_EXTRA_TABLES = $0008; |
| 227 |
{$ENDIF PCRE_5_0} |
{$ENDIF PCRE_5_0} |
| 228 |
{$IFDEF PCRE_7_0} |
{$IFDEF PCRE_7_0} |
| 229 |
PCRE_EXTRA_MATCH_LIMIT_RECURSION = $0010; |
PCRE_EXTRA_MATCH_LIMIT_RECURSION = $0010; |
| 240 |
|
|
| 241 |
type ppcre_extra = ^tpcre_extra; |
type ppcre_extra = ^tpcre_extra; |
| 242 |
tpcre_extra = record |
tpcre_extra = record |
| 243 |
flags : longint; { Bits for which fields are set } |
flags : longint; { Bits for which fields are set } |
| 244 |
study_data : pointer; { Opaque data from pcre_study() } |
study_data : pointer; { Opaque data from pcre_study() } |
| 245 |
match_limit : longint; { Maximum number of calls to match() } |
match_limit : longint; { Maximum number of calls to match() } |
| 246 |
callout_data : pointer; { Data passed back in callouts } |
callout_data : pointer; { Data passed back in callouts } |
| 417 |
{$IFDEF VIRTUALPASCAL} {&Cdecl-} {$ENDIF VIRTUALPASCAL} |
{$IFDEF VIRTUALPASCAL} {&Cdecl-} {$ENDIF VIRTUALPASCAL} |
| 418 |
|
|
| 419 |
// Always include the newest version of the library |
// Always include the newest version of the library |
| 420 |
{$IFDEF PCRE_3_7} {$IFNDEF PCRE_5_0} {$IFNDEF PCRE_7_0} {$L pcre37.lib} {$ENDIF PCRE_7_0} {$ENDIF PCRE_5_0} {$ENDIF PCRE_3_7} |
{$IFDEF PCRE_7_7} |
| 421 |
{$IFDEF PCRE_5_0} {$IFNDEF PCRE_7_0} {$L pcre50.lib} {$ENDIF PCRE_7_0} {$ENDIF PCRE_5_0} |
{$L pcre77.lib} |
| 422 |
{$IFDEF PCRE_7_0} {$L pcre70.lib} {$ENDIF PCRE_7_0} |
{$ELSE} |
| 423 |
|
{$IFDEF PCRE_7_0} |
| 424 |
|
{$L pcre70.lib} |
| 425 |
|
{$ELSE} |
| 426 |
|
{$IFDEF PCRE_5_0} |
| 427 |
|
{$L pcre50.lib} |
| 428 |
|
{$ELSE} |
| 429 |
|
{$IFDEF PCRE_3_7} |
| 430 |
|
{$L pcre37.lib} |
| 431 |
|
{$ENDIF PCRE_3_7} |
| 432 |
|
{$ENDIF PCRE_5_0} |
| 433 |
|
{$ENDIF PCRE_7_0} |
| 434 |
|
{$ENDIF PCRE_7_7} |
| 435 |
|
|
| 436 |
{TpcRegExp} |
{TpcRegExp} |
| 437 |
|
|
| 683 |
// l1:=length(PpcRegExp(P1)^.RegExp); |
// l1:=length(PpcRegExp(P1)^.RegExp); |
| 684 |
// l2:=length(PpcRegExp(P2)^.RegExp); |
// l2:=length(PpcRegExp(P2)^.RegExp); |
| 685 |
// if l1 > l2 then l:=l2 else |
// if l1 > l2 then l:=l2 else |
| 686 |
// l:=l1; |
// l:=l1; |
| 687 |
// for i:=1 to l do |
// for i:=1 to l do |
| 688 |
// if PpcRegExp(P1).RegExp[i] <> PpcRegExp(P2).RegExp[i] then break; |
// if PpcRegExp(P1).RegExp[i] <> PpcRegExp(P2).RegExp[i] then break; |
| 689 |
// if i <=l then |
// if i <=l then |
| 696 |
// l1:=length(PpcRegExp(P1)^.RegExp); |
// l1:=length(PpcRegExp(P1)^.RegExp); |
| 697 |
// l2:=length(SearchRegExp); |
// l2:=length(SearchRegExp); |
| 698 |
// if l1 > l2 then l:=l2 else |
// if l1 > l2 then l:=l2 else |
| 699 |
// l:=l1; |
// l:=l1; |
| 700 |
// for i:=1 to l do |
// for i:=1 to l do |
| 701 |
// if PpcRegExp(P1).RegExp[i] <> SearchRegExp[i] then |
// if PpcRegExp(P1).RegExp[i] <> SearchRegExp[i] then |
| 702 |
// begin |
// begin |