Mid
Description
This special Mid function returns a string between two tags. The Tags can be regular expressions.
Syntax
Function Mid( input, left_tag, right_tag, look_for, pos )
input string
left_tag (optional) - the start string used to define the output range, this string can be a regular expression
right_tag (optional) - the end string used to define the output range, this string can be a regular expression
look_for (optional) - a regular expression that defines the extraction
pos integer (optional, in/out) - the search from position (default is 0)
Return value
This function returns a string.
Sample
'---------- Start ----------
Function Start
Dim str, str2
str = "10-AFDT75P-15"
str2 = target.strlib.Mid( str, "\-", "\-" )
trg.Message( str2 )
End Function
In this case Mid is used to extract the middle part of the input string and searches between two dashes to extract AFDT75P.
See also