VSS.Regular_Expressions

Entities

Simple Types

Array Types

Tagged Types

Constants

Subprograms

Description

Copyright (C) 2021-2023, AdaCore

SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

"="

function "="
  (Left : Regular_Expression; Right : Regular_Expression) return Boolean
Parameters
Left
Right
Return Value

"="

function "="
  (Left  : Regular_Expression_Match;
   Right : Regular_Expression_Match) return Boolean
Parameters
Left
Right
Return Value

Capture_Group_Count

function Capture_Group_Count
  (Self : Regular_Expression'Class) return Natural
Parameters
Self
Return Value

Capture_Group_Names

function Capture_Group_Names
  (Self : Regular_Expression'Class)
   return VSS.String_Vectors.Virtual_String_Vector
Parameters
Self
Return Value

Captured

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.

Parameters
Self
Index
Return Value

Captured

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.

Parameters
Self
Name
Return Value

Error_String

function Error_String
  (Self : Regular_Expression'Class) return VSS.Strings.Virtual_String
Parameters
Self
Return Value

First_Marker

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.

Parameters
Self
Index
Return Value

First_Marker

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.

Parameters
Self
Name
Return Value

Has_Capture

function Has_Capture
  (Self  : Regular_Expression_Match'Class;
   Index : Positive) return Boolean

Check if the capturing group with given Index has been captured.

Parameters
Self
Index
Return Value

Has_Match

function Has_Match (Self : Regular_Expression_Match'Class) return Boolean

Return True when regular expression matched against the subject string.

Parameters
Self
Return Value

Is_Valid

function Is_Valid (Self : Regular_Expression'Class) return Boolean
Parameters
Self
Return Value

Is_Valid

function Is_Valid (Self : Regular_Expression_Match'Class) return Boolean

Return True when object was obtained as result of matching of valid regular expression.

Parameters
Self
Return Value

Last_Marker

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.

Parameters
Self
Index
Return Value

Last_Marker

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.

Parameters
Self
Name
Return Value

Marker

function Marker
  (Self  : Regular_Expression_Match'Class;
   Index : Natural := 0)
   return VSS.Strings.Cursors.Markers.Segment_Marker

Return segment marker for capture group Index.

Parameters
Self
Index
Return Value

Marker

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.

Parameters
Self
Name
Return Value

Match

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.

Parameters
Self
Subject
Options
Return Value

Match

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.

Parameters
Self
Subject
From
Options
Return Value

Match_Option

type Match_Option is
  (Anchored_Match);
Enumeration Literal
Anchored_Match

Match whole string

Match_Options

type Match_Options is array (Match_Option) of Boolean;

No_Match_Options

No_Match_Options : constant Match_Options := [others => False];

No_Pattern_Options

No_Pattern_Options : constant Pattern_Options := [others => False];

Options

function Options (Self : Regular_Expression'Class) return Pattern_Options
Parameters
Self
Return Value

Pattern

function Pattern
  (Self : Regular_Expression'Class) return VSS.Strings.Virtual_String
Parameters
Self
Return Value

Pattern_Option

type Pattern_Option is
  (Case_Insensitive,
   Dot_Matches_Everything,
   Multiline,
   Extended_Pattern_Syntax,
   Inverted_Greediness,
   Dont_Capture,
   Dont_Use_Unicode_Properties);
Enumeration Literal
Case_Insensitive
Dot_Matches_Everything
Multiline
Extended_Pattern_Syntax
Inverted_Greediness
Dont_Capture
Dont_Use_Unicode_Properties

Pattern_Options

type Pattern_Options is array (Pattern_Option) of Boolean;

Regular_Expression

type Regular_Expression is tagged private;

Regular_Expression_Match

type Regular_Expression_Match is tagged private;

To_Regular_Expression

function To_Regular_Expression
  (Pattern : VSS.Strings.Virtual_String;
   Options : Pattern_Options := No_Pattern_Options)
   return Regular_Expression
Parameters
Pattern
Options
Return Value