Abstraction layer over PCRE2.
Opaque regular expression type.
Creates new regular expression type from given pattern. Returns
E_REGEX_COMPILE
on error.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(regex_type), | intent(out) | :: | regex |
Regular expression type. |
||
character(len=*), | intent(in) | :: | pattern |
Pattern to compile. |
||
character(len=:), | intent(out), | optional, | allocatable | :: | error_message |
Error message. |
integer(kind=i8), | intent(out), | optional | :: | error_offset |
Error offset in pattern. |
Returns group value in given subject from compiled regular expression.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(regex_type), | intent(inout) | :: | regex |
Regular expression type. |
||
character(len=*), | intent(in) | :: | subject |
Input string. |
||
character(len=*), | intent(in) | :: | name |
Group name. |
||
character(len=:), | intent(out), | allocatable | :: | value |
Group value. |
Returns E_NONE
if given subject matches the compiled regular
expression.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(regex_type), | intent(inout) | :: | regex |
Regular expression type. |
||
character(len=*), | intent(in) | :: | subject |
Input string to match against. |
Extracts all values by group from raw response in given request type. The regular expression is compiled and destroyed by this function. The response error is set to any occuring error code.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(request_type), | intent(inout) | :: | request |
Request type. |
Returns response string from raw response, extracted by group name
name
. If pattern
is passed, it is used as the regular expression
pattern instead of the request pattern.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(request_type), | intent(inout) | :: | request |
Request type. |
||
character(len=*), | intent(in) | :: | name |
Response name or regular expression group. |
||
character(len=:), | intent(out), | allocatable | :: | string |
String extracted from group |
|
character(len=*), | intent(in), | optional | :: | pattern |
Pattern to use instead of the request pattern. |
Destroys compiled regular expression.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(regex_type), | intent(inout) | :: | regex |
Regular expression type. |