FRM
v1.4.2

std
Script misha_std_re_func_lib

CompiledModule
  |
  +--misha_std_re_func_lib

Regular expression functions search and match for WinRunner.

Copyright (c) 2003 Misha Verplak

Supporting regex++ c++ library at www.boost.org: Copyright (c) 1998-2001 Dr John Maddock

Permission is granted to use, modify and redistribute this software provided both copyrights appear in all copies.

This script and dll provides WinRunner with perl-like regular expression search and match functions, to supplement the limited builtin function match() and add GUI properties "label_like" and "id_like" for window recognition.

Known bugs:

Version:
0.2 2003-01-21
Author:
Misha Verplack
See Also:
Readme, sample, startup, Regex syntax description
Tsl
misha_std_re_func_lib.tsl

Function Summary
protected  String _detail_decode(in detail, in position, in nbytes)
           
 String re_func_init()
          initialises the re_func
 String re_get_detail(in detail, in submatch, out nsubs, out line, out position, out len)
          Get the (sub)match position and length from the detail.
 String re_get_match(in orig_str, in detail, in submatch, out match_str)
          Get the (sub)matched string from the detail.
 extern._int re_match(in._string str, in._string re, out._int m_pos, out._int m_len, inout._string detail)
          Match a regular expression to a whole string.
 String re_print_detail(in detail)
          Print the re match details to the debug window.
 extern._int re_search(in._string str, in._string re, out._int m_pos, out._int m_len, inout._string detail)
          Search a string for a regular expression.
 

Function Detail

re_match

public extern._int re_match(in._string str,
                            in._string re,
                            out._int m_pos,
                            out._int m_len,
                            inout._string detail)
Match a regular expression to a whole string. Submatch results in 'detail', use re_get_details() or re_get_match().

Parameters:
str - string to search
re - regular expression
m_pos - matched position
m_len - matched length
detail - detail
Returns:
0 = no match, 1 = found match, gets position and length

re_search

public extern._int re_search(in._string str,
                             in._string re,
                             out._int m_pos,
                             out._int m_len,
                             inout._string detail)
Search a string for a regular expression. Submatch results in 'detail', use re_get_details() or re_get_match().

Parameters:
str - string to search
re - regular expression
m_pos - matched position
m_len - matched length
detail - detail
Returns:
0 = no match, 1 = found match, gets position and length

re_func_init

public String re_func_init()
initialises the re_func


_detail_decode

protected String _detail_decode(in detail,
                                in position,
                                in nbytes)
Parameters:
detail -
position -
nbytes -
Returns:

re_print_detail

public String re_print_detail(in detail)
Print the re match details to the debug window. Typically used after re_search() or re_match().

Parameters:
detail - (1 byte ) size of this detail, ie. number of submatches + 1 (2 bytes) line number where match occurred, counting from 1 [(2 bytes) position of (sub)match, 0-th submatch is whole match [(2 bytes) length of (sub)match [--------- repeated to a maximum of 50 submatches ---]
Returns:

re_get_detail

public String re_get_detail(in detail,
                            in submatch,
                            out nsubs,
                            out line,
                            out position,
                            out len)
Get the (sub)match position and length from the detail. Typically used after re_search() or re_match()\nsubmatch can be 0 for whole match.

Parameters:
detail -
submatch -
nsubs -
line -
position -
len -
Returns:

re_get_match

public String re_get_match(in orig_str,
                           in detail,
                           in submatch,
                           out match_str)
Get the (sub)matched string from the detail. Typically used after re_search() or re_match()\nsubmatch can be 0 for whole match.

Parameters:
orig_str -
detail -
submatch -
match_str -
Returns:

FRM
v1.4.2