+
Point of view
All features
deferred class REGULAR_EXPRESSION
Summary
Regular expression matching and substitution capabilities. Use REGULAR_EXPRESSION_BUILDER to create REGULAR_EXPRESSION objects.
See tutorial/regular_expression for usage.
Direct parents
Insert list: ANY
Known children
Inherit list: BACKTRACKING_REGULAR_EXPRESSION
Class invariant
Overview
Features
matching capabilities
{ANY}
substitution capabilities
{ANY}
Error informations
{ANY}
{}
{}
match (text: ABSTRACT_STRING): BOOLEAN
effective function
{ANY}
Returns True if Current regular_expression can match the text.
match_from (text: ABSTRACT_STRING, first_index: INTEGER_32): BOOLEAN
deferred function
{ANY}
Returns True if Current regular_expression can match the text starting from first_index.
match_next (text: ABSTRACT_STRING): BOOLEAN
effective function
{ANY}
Returns True if Current regular_expression can match the same text one more time.
last_match_succeeded: BOOLEAN
effective function
{ANY}
Did last match succeed?
last_match_first_index: INTEGER_32
effective function
{ANY}
The starting position in the text where starts the sub-string who is matching the whole pattern.
last_match_last_index: INTEGER_32
effective function
{ANY}
The last position in the text where starts the sub-string who is matching the whole pattern.
last_match_count: INTEGER_32
effective function
{ANY}
Length of the string matching the whole pattern.
group_count: INTEGER_32
effective function
{ANY}
Number of groups in Current regular expression.
group_names: TRAVERSABLE[FIXED_STRING]
effective function
{ANY}
The names of the matched named group.
has_group_name (name: ABSTRACT_STRING): BOOLEAN
effective function
{ANY}
Is there a group names name?
ith_group_matched (i: INTEGER_32): BOOLEAN
effective function
{ANY}
Did the ith group match during last match?
named_group_matched (name: ABSTRACT_STRING): BOOLEAN
effective function
{ANY}
Did the group named name match during the last match?
ith_group_first_index (i: INTEGER_32): INTEGER_32
effective function
{ANY}
First index in the last matching text of the ith group.
named_group_first_index (name: ABSTRACT_STRING): INTEGER_32
effective function
{ANY}
First index in the last matching text of the group named name.
ith_group_last_index (i: INTEGER_32): INTEGER_32
effective function
{ANY}
Last index in the last matching text of the ith group.
named_group_last_index (name: ABSTRACT_STRING): INTEGER_32
effective function
{ANY}
Last index in the last matching text of the group named name.
ith_group_count (i: INTEGER_32): INTEGER_32
effective function
{ANY}
Length of the ith group of Current in the last matching.
named_group_count (name: ABSTRACT_STRING): INTEGER_32
effective function
{ANY}
Length of the group named name in the last matching.
for_all_matched_named_groups (text: ABSTRACT_STRING, action: PROCEDURE[TUPLE 2[FIXED_STRING, STRING]])
effective procedure
{ANY}
Call the action for each group that matched during the last match.
append_heading_text (text: ABSTRACT_STRING, buffer: STRING)
effective procedure
{ANY}
Append in buffer the text before the matching area.
append_pattern_text (text: ABSTRACT_STRING, buffer: STRING)
effective procedure
{ANY}
Append in buffer the text matching the pattern.
append_tailing_text (text: ABSTRACT_STRING, buffer: STRING)
effective procedure
{ANY}
Append in buffer the text after the matching area.
append_ith_group (text: ABSTRACT_STRING, buffer: STRING, i: INTEGER_32)
effective procedure
{ANY}
Append in buffer the text of the ith group.
append_named_group (text: ABSTRACT_STRING, buffer: STRING, name: ABSTRACT_STRING)
effective procedure
{ANY}
Append in buffer the text of the group named name.
named_group_value (text: ABSTRACT_STRING, name: ABSTRACT_STRING): STRING
effective function
{ANY}
Returns the text of the group named name (always the same STRING!)
prepare_substitution (p: ABSTRACT_STRING)
effective procedure
{ANY}
Set pattern p for substitution.
last_substitution: STRING
effective function
{ANY}
You need to copy this STRING if you want to keep it.
substitute_for (text: ABSTRACT_STRING)
effective procedure
{ANY}
This call has to be preceded by a successful matching on the same text.
substitute_in (text: STRING)
effective procedure
{ANY}
This call has to be preceded by a successful matching on the same text.
substitute_all_for (text: ABSTRACT_STRING)
effective procedure
{ANY}
Every matching part is substituted.
substitute_all_in (text: STRING)
effective procedure
{ANY}
Every matching part is substituted.
can_substitute: BOOLEAN
effective function
{ANY}
Substitution is only allowed when some valid substitution pattern has been registered and after a successful pattern matching.
substitution_pattern_ready: BOOLEAN
writable attribute
{ANY}
True if some valid substitution pattern has been registered.
pattern_error_message: STRING
writable attribute
{ANY}
Error message for the substitution pattern.
pattern_error_position: INTEGER_32
writable attribute
{ANY}
Error position in the substitution pattern.
save_matching_text (text: ABSTRACT_STRING): BOOLEAN
effective function
{}
Used in assertion only.
invalidate_last_match
effective procedure
{}
Used to prevent 2 substitutions without intermediate matching.
valid_substrings (text: ABSTRACT_STRING): BOOLEAN
effective function
{}
Used in assertion only.
valid_substitution: BOOLEAN
effective function
{}
Used in assertion only.
substitute_all_without_tail (text: ABSTRACT_STRING): INTEGER_32
effective function
{}
Substitute all matching parts from text.
substrings_first_indexes: ARRAY[INTEGER_32]
writable attribute
{}
Item(0) is the starting position in the text where starts the substring who is matching the whole pattern.
substrings_last_indexes: ARRAY[INTEGER_32]
writable attribute
{}
The ending position of the string starting at position found in matching_position at the same index.
writable attribute
{}
The names of the groups, if those names exist
group_names_memory: COLLECTION[FIXED_STRING]
writable attribute
{}
Cache for group_names
substitution_pattern: STRING
once function
{}
compiled_substitution_pattern: FAST_ARRAY[INTEGER_32]
writable attribute
{}
This array describe the substitution text as a suite of strings from substrings_first_indexes.
last_match_text: STRING
effective function
{}
For assertion only.
set_group_names_memory
effective procedure
{}
last_match_text_memory: STRING
writable attribute
{}
For assertion only.
last_substitution_memory: STRING
writable attribute
{}
_inline_agent38 (s: FIXED_STRING): BOOLEAN
frozen
effective function
{}
_inline_agent39 (s: FIXED_STRING): BOOLEAN
frozen
effective function
{}
_inline_agent40 (s: FIXED_STRING): BOOLEAN
frozen
effective function
{}
_inline_agent41 (i: INTEGER_32, s: FIXED_STRING): BOOLEAN
frozen
effective function
{}