Copyright (C) 2021-2023, AdaCore
SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
function "="
(Left : Regular_Expression; Right : Regular_Expression) return Boolean
function "="
(Left : Regular_Expression_Match;
Right : Regular_Expression_Match) return Boolean
function Capture_Group_Count
(Self : Regular_Expression'Class) return Natural
function Capture_Group_Names
(Self : Regular_Expression'Class)
return VSS.String_Vectors.Virtual_String_Vector
function Captured
(Self : Regular_Expression_Match'Class;
Index : Natural := 0) return VSS.Strings.Virtual_String
Return substring captured by the Index capturing group. If capture group did not captured substring or there is no such captured group, returned string is null. Capture group 0 means substring matched by the entire pattern.
function Captured
(Self : Regular_Expression_Match'Class;
Name : VSS.Strings.Virtual_String) return VSS.Strings.Virtual_String
Return substring captured by the named capture group Name. If capture group did not captured substring or there is no such named captured group, returned string is null.
function Error_String
(Self : Regular_Expression'Class) return VSS.Strings.Virtual_String
function First_Marker
(Self : Regular_Expression_Match'Class;
Index : Natural := 0)
return VSS.Strings.Cursors.Markers.Character_Marker
Return marker at first position of the substring captured by capture group Index.
function First_Marker
(Self : Regular_Expression_Match'Class;
Name : VSS.Strings.Virtual_String)
return VSS.Strings.Cursors.Markers.Character_Marker
Return marker at first position of the substring captured by named capture group Name.
function Has_Capture
(Self : Regular_Expression_Match'Class;
Index : Positive) return Boolean
Check if the capturing group with given Index has been captured.
function Has_Match (Self : Regular_Expression_Match'Class) return Boolean
Return True when regular expression matched against the subject string.
function Is_Valid (Self : Regular_Expression'Class) return Boolean
function Is_Valid (Self : Regular_Expression_Match'Class) return Boolean
Return True when object was obtained as result of matching of valid regular expression.
function Last_Marker
(Self : Regular_Expression_Match'Class;
Index : Natural := 0)
return VSS.Strings.Cursors.Markers.Character_Marker
Return marker at last position of the substring captured by capture group Index.
function Last_Marker
(Self : Regular_Expression_Match'Class;
Name : VSS.Strings.Virtual_String)
return VSS.Strings.Cursors.Markers.Character_Marker
Return marker at last position of the substring captured by named capture group Name.
function Marker
(Self : Regular_Expression_Match'Class;
Index : Natural := 0)
return VSS.Strings.Cursors.Markers.Segment_Marker
Return segment marker for capture group Index.
function Marker
(Self : Regular_Expression_Match'Class;
Name : VSS.Strings.Virtual_String)
return VSS.Strings.Cursors.Markers.Segment_Marker
Return segment marker for named capture group Name.
function Match
(Self : Regular_Expression'Class;
Subject : VSS.Strings.Virtual_String;
Options : Match_Options := No_Match_Options)
return Regular_Expression_Match
Perform a regular expression match of the Subject against given regexp taking Options (if provided) into account.
function Match
(Self : Regular_Expression'Class;
Subject : VSS.Strings.Virtual_String;
From : VSS.Strings.Cursors.Abstract_Cursor'Class;
Options : Match_Options := No_Match_Options)
return Regular_Expression_Match
Perform a regular expression match of the Subject starting from given position (From) against the regexp. Take Options (if provided) into account. The beginning of a line assertion (`^`) matches From position even if Subject has character before it.
type Match_Option is
(Anchored_Match);
Match whole string
type Match_Options is array (Match_Option) of Boolean;
No_Match_Options : constant Match_Options := [others => False];
No_Pattern_Options : constant Pattern_Options := [others => False];
function Options (Self : Regular_Expression'Class) return Pattern_Options
function Pattern
(Self : Regular_Expression'Class) return VSS.Strings.Virtual_String
type Pattern_Option is
(Case_Insensitive,
Dot_Matches_Everything,
Multiline,
Extended_Pattern_Syntax,
Inverted_Greediness,
Dont_Capture,
Dont_Use_Unicode_Properties);
type Pattern_Options is array (Pattern_Option) of Boolean;
type Regular_Expression is tagged private;
type Regular_Expression_Match is tagged private;
function To_Regular_Expression
(Pattern : VSS.Strings.Virtual_String;
Options : Pattern_Options := No_Pattern_Options)
return Regular_Expression