The Regex package provides regex search functionality. The major functionalities offered in the Regex Package are the following:

  • SetPattern() and Match() provide matching functionality.

  • For more information please see this link at wikipedia.

    Examples:

    Regex r
    r.SetPattern ( '([[:alnum:]]+)(\.|_)?([[:alnum:]]*)@([[:alnum:]]+)(\.([[:alnum:]]+))+' )
    echo ( r.Match ( 'marius.bancila@domain.com' ) )
    echo ( r.Match ( 'marius@domain' ) )

    Class Methods Index

     o Boolean Match( String value )
    Returns TRUE if the value specified matches the pattern for this regex

     o void SetPattern( String pattern )
    Sets the pattern string to use for matching

    Class Methods

     o Match
     Boolean Match(
                String value)
    

    Evaluates value against the regular expression specified in the SetPattern() function

    Parameters:
    value  -  String to be evaluated
    Returns:
    TRUE if a match is found, FALSE otherwise.

     o SetPattern
     void SetPattern(
                String pattern)
    

    Sets the pattern to be used for matches for this regex instance. Note: this regex only supports POSIX character classes.

    Parameters:
    pattern  -  String containing the regex pattern
    Returns:
    Nothing