GNU
|
Liberty Eiffel
|
Automated Tests
|
Wiki
|
Savannah project
|
Debian packages
|
Documentation
>
libraries
>
REGULAR_EXPRESSION_BUILDER
+
Point of view
All features
ANY
All features
expanded class REGULAR_EXPRESSION_BUILDER
Summary
top
Regular expression building from various dialects. Some
REGULAR_EXPRESSION
object is build from a string describing a pattern. A regular expression is a pattern that is matched against a subject string.
See tutorial/regular_expression for usage.
Direct parents
Insert list:
ANY
Overview
top
Features
Building
REGULAR_EXPRESSION
{
ANY
}
convert_posix_pattern
(p:
STRING
):
REGULAR_EXPRESSION
Create some
REGULAR_EXPRESSION
from the pattern
p
according to POSIX syntax.
convert_perl_pattern
(p:
STRING
):
REGULAR_EXPRESSION
Create some
REGULAR_EXPRESSION
from the pattern
p
according to Perl syntax.
convert_python_pattern
(p:
STRING
):
REGULAR_EXPRESSION
Create some
REGULAR_EXPRESSION
from the pattern
p
according to Python syntax.
options
{
ANY
}
is_case_insensitive
:
BOOLEAN
Is the match case insensitive?
is_case_sensitive
:
BOOLEAN
Is the match case sensitive?
set_case_sensitive
Set the match as case sensitive.
set_case_insensitive
Set the match as case insensitive.
does_any_match_newline
:
BOOLEAN
Does the
"any character"
mark match a newline?
set_any_match_newline
The
"any character"
mark will match a newline.
set_any_dont_match_newline
The
"any character"
mark will not match a newline.
does_match_line_boundary
:
BOOLEAN
Does the begin/end marks match line boundary?
does_match_text_boundary
:
BOOLEAN
Does the begin/end marks match text boundary?
set_match_line_boundary
The begin/end marks will match line boundary.
set_match_text_boundary
The begin/end marks will match text boundary.
has_extended_legibility
:
BOOLEAN
Is the extended legibility active?
has_extended_ligibility
:
BOOLEAN
set_extended_legibility
Activate extended legibility.
set_extended_ligibility
set_no_extended_legibility
Deactivate extended legibility.
set_no_extended_ligibility
set_default_options
Set the default options
Error informations
{
ANY
}
last_error_message
:
STRING
Used to report error during last creation attempt.
last_error_position
:
INTEGER_32
Used to report error position during last creation attempt.
Internal
{}
posix_builder
:
POSIX_REGULAR_EXPRESSION_BUILDER
The builder for the POSIX syntax
perl5_builder
:
PERL5_REGULAR_EXPRESSION_BUILDER
The builder for the PERL5 syntax
python_builder
:
PYTHON_REGULAR_EXPRESSION_BUILDER
The builder for the Python syntax
convert_backtracking_pattern
(p:
STRING
, builder:
BACKTRACKING_REGULAR_EXPRESSION_BUILDER
):
BACKTRACKING_REGULAR_EXPRESSION
Create some
BACKTRACKING_REGULAR_EXPRESSION
from the pattern
p
according to the syntax passed by the given 'builder'.
convert_posix_pattern
(p:
STRING
):
REGULAR_EXPRESSION
effective function
{
ANY
}
top
Create some
REGULAR_EXPRESSION
from the pattern
p
according to POSIX syntax.
If
p
is not a valid regular expression according to POSIX syntax, then
Result
is Void and
last_error_message
and
last_error_position
are set.
require
p /= Void
ensure
Result /= Void xor
last_error_message
/= Void
initialized:
Result /= Void implies not Result.last_match_succeeded
substitution_cleared:
Result /= Void implies not Result.substitution_pattern_ready
convert_perl_pattern
(p:
STRING
):
REGULAR_EXPRESSION
effective function
{
ANY
}
top
Create some
REGULAR_EXPRESSION
from the pattern
p
according to Perl syntax.
If
p
is not a valid regular expression according to Perl syntax, then
Result
is Void and
last_error_message
and
last_error_position
are set.
require
p /= Void
ensure
Result /= Void xor
last_error_message
/= Void
initialized:
Result /= Void implies not Result.last_match_succeeded
substitution_cleared:
Result /= Void implies not Result.substitution_pattern_ready
convert_python_pattern
(p:
STRING
):
REGULAR_EXPRESSION
effective function
{
ANY
}
top
Create some
REGULAR_EXPRESSION
from the pattern
p
according to Python syntax.
If
p
is not a valid regular expression according to Python syntax, then
Result
is Void and
last_error_message
and
last_error_position
are set.
require
p /= Void
ensure
Result /= Void xor
last_error_message
/= Void
initialized:
Result /= Void implies not Result.last_match_succeeded
substitution_cleared:
Result /= Void implies not Result.substitution_pattern_ready
is_case_insensitive
:
BOOLEAN
writable attribute
{
ANY
}
top
Is the match case insensitive?
Default is False
is_case_sensitive
:
BOOLEAN
effective function
{
ANY
}
top
Is the match case sensitive?
Default is True
set_case_sensitive
effective procedure
{
ANY
}
top
Set the match as case sensitive.
ensure
definition:
is_case_insensitive
= False and
is_case_sensitive
= True
set_case_insensitive
effective procedure
{
ANY
}
top
Set the match as case insensitive.
ensure
definition:
is_case_insensitive
= True and
is_case_sensitive
= False
does_any_match_newline
:
BOOLEAN
writable attribute
{
ANY
}
top
Does the
"any character"
mark match a newline?
Default is False
set_any_match_newline
effective procedure
{
ANY
}
top
The
"any character"
mark will match a newline.
ensure
definition:
does_any_match_newline
= True
set_any_dont_match_newline
effective procedure
{
ANY
}
top
The
"any character"
mark will not match a newline.
ensure
definition:
does_any_match_newline
= False
does_match_line_boundary
:
BOOLEAN
writable attribute
{
ANY
}
top
Does the begin/end marks match line boundary?
Default is False
does_match_text_boundary
:
BOOLEAN
effective function
{
ANY
}
top
Does the begin/end marks match text boundary?
Default is True
ensure
definition:
Result = not
does_match_line_boundary
set_match_line_boundary
effective procedure
{
ANY
}
top
The begin/end marks will match line boundary.
ensure
definition:
does_match_line_boundary
= True and
does_match_text_boundary
= False
set_match_text_boundary
effective procedure
{
ANY
}
top
The begin/end marks will match text boundary.
ensure
definition:
does_match_line_boundary
= False and
does_match_text_boundary
= True
has_extended_legibility
:
BOOLEAN
writable attribute
{
ANY
}
top
Is the extended legibility active?
has_extended_ligibility
:
BOOLEAN
effective function
{
ANY
}
top
This feature is obsolete:
Use `has_extended_legibility' instead.
set_extended_legibility
effective procedure
{
ANY
}
top
Activate extended legibility.
ensure
definition:
has_extended_legibility
= True
set_extended_ligibility
effective procedure
{
ANY
}
top
This feature is obsolete:
Use `set_extended_legibility' instead.
set_no_extended_legibility
effective procedure
{
ANY
}
top
Deactivate extended legibility.
ensure
definition:
has_extended_legibility
= False
set_no_extended_ligibility
effective procedure
{
ANY
}
top
This feature is obsolete:
Use `set_no_extended_legibility' instead.
set_default_options
effective procedure
{
ANY
}
top
Set the default options
ensure
is_case_sensitive
not
does_any_match_newline
does_match_text_boundary
not
has_extended_legibility
last_error_message
:
STRING
writable attribute
{
ANY
}
top
Used to report error during last creation attempt.
See also
convert_perl_pattern
,
convert_posix_pattern
.
last_error_position
:
INTEGER_32
writable attribute
{
ANY
}
top
Used to report error position during last creation attempt.
See also
convert_perl_pattern
,
convert_posix_pattern
.
posix_builder
:
POSIX_REGULAR_EXPRESSION_BUILDER
once function
{}
top
The builder for the POSIX syntax
perl5_builder
:
PERL5_REGULAR_EXPRESSION_BUILDER
once function
{}
top
The builder for the PERL5 syntax
python_builder
:
PYTHON_REGULAR_EXPRESSION_BUILDER
once function
{}
top
The builder for the Python syntax
convert_backtracking_pattern
(p:
STRING
, builder:
BACKTRACKING_REGULAR_EXPRESSION_BUILDER
):
BACKTRACKING_REGULAR_EXPRESSION
effective function
{}
top
Create some
BACKTRACKING_REGULAR_EXPRESSION
from the pattern
p
according to the syntax passed by the given 'builder'.
If
p
is not a valid regular expression according the said syntax, then
Result
is Void and
last_error_message
and
last_error_message
are set.
require
p /= Void and builder /= Void
ensure
Result /= Void xor
last_error_message
/= Void
initialized:
Result /= Void implies not Result.last_match_succeeded
substitution_cleared:
Result /= Void implies not Result.substitution_pattern_ready