ajreg.c


Function ajRegComp

Compiles a regular expression.

Prototype

AjPRegexp ajRegComp (
      const AjPStr rexp
);

TypeNameRead/WriteDescription
const AjPStrrexpInputRegular expression string.
AjPRegexp RETURNCompiled regular expression.

From EMBOSS 1.0.0


Function ajRegCompC

Compiles a regular expression.

Prototype

AjPRegexp ajRegCompC (
      const char* rexp
);

TypeNameRead/WriteDescription
const char*rexpInputRegular expression character string.
AjPRegexp RETURNCompiled regular expression.

From EMBOSS 1.0.0


Function ajRegCompCase

Compiles a case-insensitive regular expression.

Prototype

AjPRegexp ajRegCompCase (
      const AjPStr rexp
);

TypeNameRead/WriteDescription
const AjPStrrexpInputRegular expression string.
AjPRegexp RETURNCompiled regular expression.

From EMBOSS 2.8.0


Function ajRegCompCaseC

Compiles a case-insensitive regular expression.

Prototype

AjPRegexp ajRegCompCaseC (
      const char* rexp
);

TypeNameRead/WriteDescription
const char*rexpInputRegular expression character string.
AjPRegexp RETURNCompiled regular expression.

From EMBOSS 2.8.0


Function ajRegExec

Execute a regular expression search. The expression must first have been compiled with ajRegComp or ajRegCompC.

Prototype

AjBool ajRegExec (
      AjPRegexp prog,
      const AjPStr str
);

TypeNameRead/WriteDescription
AjPRegexpprogModifyCompiled regular expression.
const AjPStrstrInputString to be compared.
AjBool RETURNajTrue if a match was found.

From EMBOSS 1.0.0


Function ajRegExecC

Execute a regular expression search. The expression must first have been compiled with ajRegComp or ajRegCompC.

Prototype

AjBool ajRegExecC (
      AjPRegexp prog,
      const char* str
);

TypeNameRead/WriteDescription
AjPRegexpprogModifyCompiled regular expression.
const char*strInputString to be compared.
AjBool RETURNajTrue if a match was found.

From EMBOSS 1.0.0


Function ajRegExecall

Execute a regular expression search using the alternative 'DFA' algorithm which generates all matches instead of the perl-compatible maximum match.

Prototype

AjBool ajRegExecall (
      AjPRegexp prog,
      const AjPStr str
);

TypeNameRead/WriteDescription
AjPRegexpprogModifyCompiled regular expression.
const AjPStrstrInputString to be compared.
AjBool RETURNajTrue if a match was found.

From EMBOSS 1.0.0


Function ajRegExecallC

Execute a regular expression search using the alternative 'DFA' algorithm which generates all matches instead of the perl-compatible maximum match.

Prototype

AjBool ajRegExecallC (
      AjPRegexp prog,
      const char* str
);

TypeNameRead/WriteDescription
AjPRegexpprogModifyCompiled regular expression.
const char*strInputString to be compared.
AjBool RETURNajTrue if a match was found.

From EMBOSS 1.0.0


Function ajRegGetMatches

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.

Prototype

ajint ajRegGetMatches (
      const AjPRegexp rp
);

TypeNameRead/WriteDescription
const AjPRegexprpInputCompiled regular expression.
ajint RETURNNumber of matches found

From EMBOSS 1.0.0


Function ajRegOffset

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.

Prototype

ajint ajRegOffset (
      const AjPRegexp rp
);

TypeNameRead/WriteDescription
const AjPRegexprpInputCompiled regular expression.
ajint RETURNOffset of match from start of string. -1 if the string and the expression do not match.

From EMBOSS 1.0.0


Function ajRegOffsetI

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.

Prototype

ajint ajRegOffsetI (
      const AjPRegexp rp,
      ajint isub
);

TypeNameRead/WriteDescription
const AjPRegexprpInputCompiled regular expression.
ajintisubInputSubstring number.
ajint RETURNOffset of match from start of string. -1 if the string and the expression do not match.

From EMBOSS 1.0.0


Function ajRegLenI

After a successful comparison, returns the length of a substring.

Prototype

ajint ajRegLenI (
      const AjPRegexp rp,
      ajint isub
);

TypeNameRead/WriteDescription
const AjPRegexprpInputCompiled regular expression.
ajintisubInputSubstring number.
ajint RETURNSubstring length, or 0 if not found.

From EMBOSS 1.0.0


Function ajRegPost

After a successful match, returns the remainder of the string.

Prototype

AjBool ajRegPost (
      const AjPRegexp rp,
      AjPStr* post
);

TypeNameRead/WriteDescription
const AjPRegexprpInputCompiled regular expression.
AjPStr*postOutputString to hold the result.
AjBool RETURNajTrue on success.

From EMBOSS 1.0.0


Function ajRegPostC

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.

Prototype

AjBool ajRegPostC (
      const AjPRegexp rp,
      const char** post
);

TypeNameRead/WriteDescription
const AjPRegexprpInputCompiled regular expression.
const char**postOutputCharacter string to hold the result.
AjBool RETURNajTrue on success.

From EMBOSS 1.0.0


Function ajRegPre

After a successful match, returns the string before the match.

Prototype

AjBool ajRegPre (
      const AjPRegexp rp,
      AjPStr* dest
);

TypeNameRead/WriteDescription
const AjPRegexprpInputCompiled regular expression.
AjPStr*destOutputString to hold the result.
AjBool RETURNajTrue on success.

From EMBOSS 2.8.0


Function ajRegSubI

After a successful match, returns a substring.

Prototype

AjBool ajRegSubI (
      const AjPRegexp rp,
      ajint isub,
      AjPStr* dest
);

TypeNameRead/WriteDescription
const AjPRegexprpInputCompiled regular expression.
ajintisubInputSubstring number.
AjPStr*destOutputString to hold the result.
AjBool RETURNajTrue if a substring was defined ajFalse if the substring is not matched ajFalse if isub is out of range

From EMBOSS 1.0.0


Function ajRegFree

Clears and frees a compiled regular expression.

Prototype

void ajRegFree (
      AjPRegexp* pexp
);

TypeNameRead/WriteDescription
AjPRegexp*pexpDeleteCompiled regular expression.
void RETURN

From EMBOSS 1.0.0


Function ajRegTrace

Traces a compiled regular expression with debug calls.

Prototype

void ajRegTrace (
      const AjPRegexp rexp
);

TypeNameRead/WriteDescription
const AjPRegexprexpInputCompiled regular expression.
void RETURN

From EMBOSS 1.0.0


Function ajRegExit

Prints a summary of regular expression (AjPRegexp) usage with debug calls

Prototype

void ajRegExit (
      void
);

TypeNameRead/WriteDescription
void RETURN

From EMBOSS 2.7.0