Skip to content

Commit

Permalink
Merge pull request #253 from Alexey-T/master
Browse files Browse the repository at this point in the history
fix #252
  • Loading branch information
andgineer authored Jul 4, 2021
2 parents 8bbc892 + 49a36db commit e487b97
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 15 deletions.
3 changes: 3 additions & 0 deletions History.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
(-) - bugfix
(^) - improvement

v. 1.153 2021.07.04
-=- (^) Compatability with Delphi 7. By Alexey Torgashin.

v. 1.152 2021.05.26
-=- (-) Fix match empty strings (e.g. by '^$'). By Alexey Torgashin.

Expand Down
31 changes: 16 additions & 15 deletions src/regexpr.pas
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
unit regexpr;
unit regexpr;

{
TRegExpr class library
Expand Down Expand Up @@ -789,7 +789,7 @@ implementation
const
// TRegExpr.VersionMajor/Minor return values of these constants:
REVersionMajor = 1;
REVersionMinor = 152;
REVersionMinor = 153;

OpKind_End = REChar(1);
OpKind_MetaClass = REChar(2);
Expand Down Expand Up @@ -6489,23 +6489,24 @@ function PrintableChar(AChar: REChar): RegExprString; {$IFDEF InlineFuncs}inline
function TRegExpr.DumpCheckerIndex(N: byte): RegExprString;
begin
Result := '?';
if N = CheckerIndex_Word then Exit('\w');
if N = CheckerIndex_NotWord then Exit('\W');
if N = CheckerIndex_Digit then Exit('\d');
if N = CheckerIndex_NotDigit then Exit('\D');
if N = CheckerIndex_Space then Exit('\s');
if N = CheckerIndex_NotSpace then Exit('\S');
if N = CheckerIndex_HorzSep then Exit('\h');
if N = CheckerIndex_NotHorzSep then Exit('\H');
if N = CheckerIndex_VertSep then Exit('\v');
if N = CheckerIndex_NotVertSep then Exit('\V');
if N = CheckerIndex_LowerAZ then Exit('az');
if N = CheckerIndex_UpperAZ then Exit('AZ');
if N = CheckerIndex_Word then Result := '\w' else
if N = CheckerIndex_NotWord then Result := '\W' else
if N = CheckerIndex_Digit then Result := '\d' else
if N = CheckerIndex_NotDigit then Result := '\D' else
if N = CheckerIndex_Space then Result := '\s' else
if N = CheckerIndex_NotSpace then Result := '\S' else
if N = CheckerIndex_HorzSep then Result := '\h' else
if N = CheckerIndex_NotHorzSep then Result := '\H' else
if N = CheckerIndex_VertSep then Result := '\v' else
if N = CheckerIndex_NotVertSep then Result := '\V' else
if N = CheckerIndex_LowerAZ then Result := 'az' else
if N = CheckerIndex_UpperAZ then Result := 'AZ' else
;
end;

function TRegExpr.DumpCategoryChars(ch, ch2: REChar; Positive: boolean): RegExprString;
const
S: array[boolean] of REChar = ('P', 'p');
S: array[boolean] of RegExprString = ('P', 'p');
begin
Result := '\' + S[Positive] + '{' + ch;
if ch2 <> #0 then
Expand Down

0 comments on commit e487b97

Please sign in to comment.