Skip to main content


Command Description

Use a Regex to find a string, and return the found substring

Command Prototype

sRet = Regex.FindStr(sText,sPattern,iGroup)

Parameter Description

sTextTruestring""The string to be operated
sPatternTruestring""Regular expression
iGroupTruenumber0Returns the matching result of the first subexpression. 0 means to return the whole matching string


sRet,The variable used to save the output of the command.


TracePrint("----------------------Regular expression find substring------------------- -----") 
//[Remarks] The regular expression searches for a string and returns the found substring of the string.
//Input parameter 1:
// sText--A string to operate on.
//Input parameter 2:
// sPattern--regular expression.
//Input parameter 3:
// iGroup--Return the matching result of the first sub-expression, 0 means return the entire matched string.
//out parameters:
// sRet--The variable to which the output of the function call is saved.
//Command prototype: sRet=Regex.FindStr(sText,sPattern,iGroup)
TracePrint (sRet)