ajreg.c
Compiles a regular expression.
Synopsis
Prototype
AjPRegexp ajRegComp (
const AjPStr rexp
);
Type | Name | Read/Write | Description |
const AjPStr | rexp | Input | Regular expression string. |
AjPRegexp | | RETURN | Compiled regular expression. |
Input
rexp: | (Input) | Regular expression string. |
Returns
AjPRegexp: | Compiled regular expression. |
Description
Compiles a regular expression.
See Also
See other functions in this section
Availability
In release 6.4.0
Compiles a regular expression.
Synopsis
Prototype
AjPRegexp ajRegCompC (
const char* rexp
);
Type | Name | Read/Write | Description |
const char* | rexp | Input | Regular expression character string. |
AjPRegexp | | RETURN | Compiled regular expression. |
Input
rexp: | (Input) | Regular expression character string. |
Returns
AjPRegexp: | Compiled regular expression. |
Description
Compiles a regular expression.
See Also
See other functions in this section
Availability
In release 6.4.0
Compiles a case-insensitive regular expression.
Synopsis
Prototype
AjPRegexp ajRegCompCase (
const AjPStr rexp
);
Type | Name | Read/Write | Description |
const AjPStr | rexp | Input | Regular expression string. |
AjPRegexp | | RETURN | Compiled regular expression. |
Input
rexp: | (Input) | Regular expression string. |
Returns
AjPRegexp: | Compiled regular expression. |
Description
Compiles a case-insensitive regular expression.
See Also
See other functions in this section
Availability
In release 6.4.0
Compiles a case-insensitive regular expression.
Synopsis
Prototype
AjPRegexp ajRegCompCaseC (
const char* rexp
);
Type | Name | Read/Write | Description |
const char* | rexp | Input | Regular expression character string. |
AjPRegexp | | RETURN | Compiled regular expression. |
Input
rexp: | (Input) | Regular expression character string. |
Returns
AjPRegexp: | Compiled regular expression. |
Description
Compiles a case-insensitive regular expression.
See Also
See other functions in this section
Availability
In release 6.4.0
Execute a regular expression search.
The expression must first have been compiled with ajRegComp or ajRegCompC.
Internal data structures in the expression will be set to substrings
which other functions can retrieve.
Synopsis
Prototype
AjBool ajRegExec (
AjPRegexp prog,
const AjPStr str
);
Type | Name | Read/Write | Description |
AjPRegexp | prog | Modify | Compiled regular expression. |
const AjPStr | str | Input | String to be compared. |
AjBool | | RETURN | ajTrue if a match was found. |
Input
str: | (Input) | String to be compared. |
Input & Output
prog: | (Modify) | Compiled regular expression. |
Returns
AjBool: | ajTrue if a match was found. |
Description
Execute a regular expression search.
The expression must first have been compiled with ajRegComp or ajRegCompC.
Internal data structures in the expression will be set to substrings
which other functions can retrieve.
See Also
See other functions in this section
Availability
In release 6.4.0
Execute a regular expression search.
The expression must first have been compiled with ajRegComp or ajRegCompC.
Internal data structures in the expression will be set to substrings
which other functions can retrieve.
Synopsis
Prototype
AjBool ajRegExecC (
AjPRegexp prog,
const char* str
);
Type | Name | Read/Write | Description |
AjPRegexp | prog | Modify | Compiled regular expression. |
const char* | str | Input | String to be compared. |
AjBool | | RETURN | ajTrue if a match was found. |
Input
str: | (Input) | String to be compared. |
Input & Output
prog: | (Modify) | Compiled regular expression. |
Returns
AjBool: | ajTrue if a match was found. |
Description
Execute a regular expression search.
The expression must first have been compiled with ajRegComp or ajRegCompC.
Internal data structures in the expression will be set to substrings
which other functions can retrieve.
See Also
See other functions in this section
Availability
In release 6.4.0
After a successful regular expression match, uses the regular
expression and the original string to calculate the offset
of the match from the start of the string.
This information is normally lost during processing.
Synopsis
Prototype
ajint ajRegOffset (
const AjPRegexp rp
);
Type | Name | Read/Write | Description |
const AjPRegexp | rp | Input | Compiled regular expression. |
ajint | | RETURN | Offset of match from start of string.
-1 if the string and the expression do not match. |
Input
rp: | (Input) | Compiled regular expression. |
Returns
ajint: | Offset of match from start of string.
-1 if the string and the expression do not match. |
Description
After a successful regular expression match, uses the regular
expression and the original string to calculate the offset
of the match from the start of the string.
This information is normally lost during processing.
See Also
See other functions in this section
Availability
In release 6.4.0
After a successful regular expression match, uses the regular
expression and the original string to calculate the offset
of a substring from the start of the string.
This information is normally lost during processing.
Synopsis
Prototype
ajint ajRegOffsetI (
const AjPRegexp rp,
ajint isub
);
Type | Name | Read/Write | Description |
const AjPRegexp | rp | Input | Compiled regular expression. |
ajint | isub | Input | Substring number. |
ajint | | RETURN | Offset of match from start of string.
-1 if the string and the expression do not match. |
Input
rp: | (Input) | Compiled regular expression. |
isub: | (Input) | Substring number. |
Returns
ajint: | Offset of match from start of string.
-1 if the string and the expression do not match. |
Description
After a successful regular expression match, uses the regular
expression and the original string to calculate the offset
of a substring from the start of the string.
This information is normally lost during processing.
See Also
See other functions in this section
Availability
In release 6.4.0
After a successful comparison, returns the length of a substring.
Synopsis
Prototype
ajint ajRegLenI (
const AjPRegexp rp,
ajint isub
);
Type | Name | Read/Write | Description |
const AjPRegexp | rp | Input | Compiled regular expression. |
ajint | isub | Input | Substring number. |
ajint | | RETURN | Substring length, or 0 if not found. |
Input
rp: | (Input) | Compiled regular expression. |
isub: | (Input) | Substring number. |
Returns
ajint: | Substring length, or 0 if not found. |
Description
After a successful comparison, returns the length of a substring.
See Also
See other functions in this section
Availability
In release 6.4.0
After a successful match, returns the remainder of the string.
Synopsis
Prototype
AjBool ajRegPost (
const AjPRegexp rp,
AjPStr* post
);
Type | Name | Read/Write | Description |
const AjPRegexp | rp | Input | Compiled regular expression. |
AjPStr* | post | Output | String to hold the result. |
AjBool | | RETURN | ajTrue on success. |
Input
rp: | (Input) | Compiled regular expression. |
Output
post: | (Output) | String to hold the result. |
Returns
AjBool: | ajTrue on success. |
Description
After a successful match, returns the remainder of the string.
See Also
See other functions in this section
Availability
In release 6.4.0
After a successful match, returns the remainder of the string.
Result is a character string, which is set to point to the internal
string data. This in turn is part of the original string. If this
changes then the results are undefined.
Synopsis
Prototype
AjBool ajRegPostC (
const AjPRegexp rp,
const char** post
);
Type | Name | Read/Write | Description |
const AjPRegexp | rp | Input | Compiled regular expression. |
const char** | post | Output | Character string to hold the result. |
AjBool | | RETURN | ajTrue on success. |
Input
rp: | (Input) | Compiled regular expression. |
Output
post: | (Output) | Character string to hold the result. |
Returns
AjBool: | ajTrue on success. |
Description
After a successful match, returns the remainder of the string.
Result is a character string, which is set to point to the internal
string data. This in turn is part of the original string. If this
changes then the results are undefined.
See Also
See other functions in this section
Availability
In release 6.4.0
After a successful match, returns the string before the match.
Synopsis
Prototype
AjBool ajRegPre (
const AjPRegexp rp,
AjPStr* dest
);
Type | Name | Read/Write | Description |
const AjPRegexp | rp | Input | Compiled regular expression. |
AjPStr* | dest | Output | String to hold the result. |
AjBool | | RETURN | ajTrue on success. |
Input
rp: | (Input) | Compiled regular expression. |
Output
dest: | (Output) | String to hold the result. |
Returns
AjBool: | ajTrue on success. |
Description
After a successful match, returns the string before the match.
See Also
See other functions in this section
Availability
In release 6.4.0
After a successful match, returns a substring.
Synopsis
Prototype
AjBool ajRegSubI (
const AjPRegexp rp,
ajint isub,
AjPStr* dest
);
Type | Name | Read/Write | Description |
const AjPRegexp | rp | Input | Compiled regular expression. |
ajint | isub | Input | Substring number. |
AjPStr* | dest | Output | String to hold the result. |
AjBool | | RETURN | ajTrue if a substring was defined
ajFalse if the substring is not matched
ajFalse if isub is out of range |
Input
rp: | (Input) | Compiled regular expression. |
isub: | (Input) | Substring number. |
Output
dest: | (Output) | String to hold the result. |
Returns
AjBool: | ajTrue if a substring was defined
ajFalse if the substring is not matched
ajFalse if isub is out of range |
Description
After a successful match, returns a substring.
See Also
See other functions in this section
Availability
In release 6.4.0
Clears and frees a compiled regular expression.
Synopsis
Prototype
void ajRegFree (
AjPRegexp* pexp
);
Type | Name | Read/Write | Description |
AjPRegexp* | pexp | Delete | Compiled regular expression. |
void | | RETURN | |
Output
pexp: | (Delete) | Compiled regular expression. |
Returns
Description
Clears and frees a compiled regular expression.
See Also
See other functions in this section
Availability
In release 6.4.0
Traces a compiled regular expression with debug calls.
Synopsis
Prototype
void ajRegTrace (
const AjPRegexp rexp
);
Type | Name | Read/Write | Description |
const AjPRegexp | rexp | Input | Compiled regular expression. |
void | | RETURN | |
Input
rexp: | (Input) | Compiled regular expression. |
Returns
Description
Traces a compiled regular expression with debug calls.
See Also
See other functions in this section
Availability
In release 6.4.0
Prints a summary of regular expression (AjPRegexp) usage with debug calls
Synopsis
Prototype
void ajRegExit (
void
);
Type | Name | Read/Write | Description |
void | | RETURN | |
Returns
Description
Prints a summary of regular expression (AjPRegexp) usage with debug calls
See Also
See other functions in this section
Availability
In release 6.4.0