group Regular Expressions

Description

Regular expressions play an important role within the ferite language. They can be used from native code using a very simple interface.

group attributes
function ferite_create_regex() - Create a regular expression structure used to store various information for them
function ferite_delete_regex() - Delete a strucute created using ferite_create_regex()
function ferite_regex_dup() - Duplicate a regular expression structure
function ferite_generate_regex() - A convinience function to create and popular a regex structure
function ferite_compile_regex() - Compile a regular expression to make things faster
function ferite_regex_swap_vars() - Swap tokens with a dollar '$' symbol infront with the variables value
function ferite_execute_regex() - Execute the regular expression

Functions

function ferite_create_regex Click to go up to the list
Create a regular expression structure used to store various information for them
Declaration:
    FeriteRegex *ferite_create_regex()
Returns:
    A new FeriteRegex structure

function ferite_delete_regex Click to go up to the list
Delete a strucute created using ferite_create_regex()
Declaration:
    void ferite_delete_regex( FeriteRegex *rgx )
Parameters:
    Parameter #1: FeriteRegex *rgx - The regex to delete

function ferite_regex_dup Click to go up to the list
Duplicate a regular expression structure
Declaration:
    FeriteRegex *ferite_regex_dup( FeriteRegex *rgx )
Parameters:
    Parameter #1: FeriteRegex *rgx - The regex to duplicate
Returns:
    An exact copy of the regexular expression

function ferite_generate_regex Click to go up to the list
A convinience function to create and popular a regex structure
Declaration:
    FeriteRegex *ferite_generate_regex( FeriteScript *script, char *pattern, char *swapbuffer, char type, char *flags )
Parameters:
    Parameter #1: FeriteScript *script - The script
    Parameter #2: char *pattern - The regular expression
    Parameter #3: char *swapbuffer - The buffer that is evaluated on a match
    Parameter #4: char type - The type of the regular expression. s for a swap, m for a match, c for an assignment.
    Parameter #5: char *flags - The flags the effect the behavior of the regular expression.
Returns:
    A regular expression structure setup and populated correctly

function ferite_compile_regex Click to go up to the list
Compile a regular expression to make things faster
Declaration:
    void *ferite_compile_regex( FeriteScript *script, char *pattern, int options )
Parameters:
    Parameter #1: FeriteScript *script - The script
    Parameter #2: char *pattern - The pattern to compile
    Parameter #3: int options - The options that effect how it is compiled
Returns:
    A pointer to the in memory compiled regular expression

function ferite_regex_swap_vars Click to go up to the list
Swap tokens with a dollar '$' symbol infront with the variables value
Declaration:
    char *ferite_regex_swap_vars( char *rgxBuf, FeriteScript *script, FeriteExecuteRec *er )
Description:
This function will first check the locally scoped variables for values then will look at global variables. If the variable doesn't exist then it will be replaced by an empty string.
Parameters:
    Parameter #1: char *rgxBuf - The buffer to evaluate
    Parameter #2: FeriteScript *script - The script where to get the global variables
    Parameter #3: FeriteExecuteRec *er - The recod where to get local variables
Returns:
    A null terminate string with the variables evaluated.

function ferite_execute_regex Click to go up to the list
Execute the regular expression
Declaration:
    FeriteVariable *ferite_execute_regex( FeriteRegex *rgx, FeriteVariable *target, FeriteScript *script, FeriteExecuteRec *er )
Parameters:
    Parameter #1: FeriteRegex *rgx - The regular expression to execute
    Parameter #2: FeriteVariable *target - The string on which to apply the regular expression
    Parameter #3: FeriteScript *script - The script in which the regular expression executes.
    Parameter #4: FeriteExecuteRec *er - The execution record of the local function, this is needed for variable substitution.
Returns:
    The result of the execution, either an array or a string

Automatically generated at 8:45pm, Wednesday 08 January 2003 by feritedoc.