diff --git a/source/regexp/implementation/vss-regular_expressions-pike_engines.adb b/source/regexp/implementation/vss-regular_expressions-pike_engines.adb index f5a602f0..6937183e 100644 --- a/source/regexp/implementation/vss-regular_expressions-pike_engines.adb +++ b/source/regexp/implementation/vss-regular_expressions-pike_engines.adb @@ -1,5 +1,5 @@ -- --- Copyright (C) 2020-2022, AdaCore +-- Copyright (C) 2020-2023, AdaCore -- -- SPDX-License-Identifier: Apache-2.0 -- @@ -342,7 +342,7 @@ package body VSS.Regular_Expressions.Pike_Engines is if Found and then (not Options (Anchored_Match) or else - VSS.Strings.Character_Count (Final_Tags (Self.Last_Tag).Index) = + VSS.Strings.Character_Count (Final_Tags (2).Index) = Subject.After_Last_Character.Character_Index) then Result := new VSS.Regular_Expressions.Matches.Match diff --git a/testsuite/regexp/test_regexp-test_v406_014.adb b/testsuite/regexp/test_regexp-test_v406_014.adb index 4b22ae5b..9a1f7f34 100644 --- a/testsuite/regexp/test_regexp-test_v406_014.adb +++ b/testsuite/regexp/test_regexp-test_v406_014.adb @@ -1,10 +1,11 @@ -- --- Copyright (C) 2022, AdaCore +-- Copyright (C) 2022-2023, AdaCore -- -- SPDX-License-Identifier: Apache-2.0 -- with VSS.Regular_Expressions; +pragma Warnings (Off, "is not referenced"); with VSS.Strings.Character_Iterators; separate (Test_Regexp) diff --git a/testsuite/regexp/test_regexp-test_v406_018.adb b/testsuite/regexp/test_regexp-test_v406_018.adb index ff4fcf76..d35ddb2c 100644 --- a/testsuite/regexp/test_regexp-test_v406_018.adb +++ b/testsuite/regexp/test_regexp-test_v406_018.adb @@ -1,10 +1,11 @@ -- --- Copyright (C) 2022, AdaCore +-- Copyright (C) 2022-2023, AdaCore -- -- SPDX-License-Identifier: Apache-2.0 -- with VSS.Regular_Expressions; +pragma Warnings (Off, "is not referenced"); with VSS.Strings.Character_Iterators; separate (Test_Regexp) diff --git a/testsuite/regexp/test_regexp-test_v615_026.adb b/testsuite/regexp/test_regexp-test_v615_026.adb index 62590994..fc5719e5 100644 --- a/testsuite/regexp/test_regexp-test_v615_026.adb +++ b/testsuite/regexp/test_regexp-test_v615_026.adb @@ -1,25 +1,8 @@ ------------------------------------------------------------------------------- --- M A G I C R U N T I M E -- --- -- --- Copyright (C) 2022, AdaCore -- --- -- --- This library is free software; you can redistribute it and/or modify it -- --- under terms of the GNU General Public License as published by the Free -- --- Software Foundation; either version 3, or (at your option) any later -- --- version. This library is distributed in the hope that it will be useful, -- --- but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN- -- --- TABILITY or FITNESS FOR A PARTICULAR PURPOSE. -- --- -- --- As a special exception under Section 7 of GPL version 3, you are granted -- --- additional permissions described in the GCC Runtime Library Exception, -- --- version 3.1, as published by the Free Software Foundation. -- --- -- --- You should have received a copy of the GNU General Public License and -- --- a copy of the GCC Runtime Library Exception along with this program; -- --- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -- --- . -- --- -- ------------------------------------------------------------------------------- +-- +-- Copyright (C) 2022-2023, AdaCore +-- +-- SPDX-License-Identifier: Apache-2.0 +-- with VSS.Regular_Expressions; with VSS.Strings; @@ -33,6 +16,8 @@ procedure Test_V615_026 is VSS.Regular_Expressions.To_Regular_Expression ("bc"); R2 : constant VSS.Regular_Expressions.Regular_Expression := VSS.Regular_Expressions.To_Regular_Expression ("^bc"); + R3 : constant VSS.Regular_Expressions.Regular_Expression := + VSS.Regular_Expressions.To_Regular_Expression ("(b)c"); M : VSS.Regular_Expressions.Regular_Expression_Match; X : constant VSS.Regular_Expressions.Match_Options := @@ -52,6 +37,10 @@ begin Test_Support.Assert (M.Has_Match); M := R2.Match (BC); Test_Support.Assert (M.Has_Match); + M := R3.Match (BC, X); + Test_Support.Assert (M.Has_Match); + M := R3.Match (ABC, X); + Test_Support.Assert (not M.Has_Match); if Pos.Forward then -- Skip `a` M := R2.Match (ABC, Pos);