Skip to main content

Find-All-with-Regular-Expression

Command Description

Use a Regex to find all strings, and return an array of found strings

Command Prototype

arrRet = Regex.FindAll(sText,sPattern)

Parameter Description

ParameterRequiredTypeDefaultDescription
sTextTruestring""The string to be operated
sPatternTruestring""Regular expression

return

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

Demo

TracePrint("----------------------Regular expression find all-------------------- ----") 
//-------------------------------------------------------------------------------
//[Remarks] The regular expression searches all strings and returns the found string array.
//Input parameter 1:
// sText--A string to operate on.
//Input parameter 2:
// sPattern--regular expression.
//out parameters:
// arrRet--The variable to which the output of the function call is saved.
//
//Command prototype: arrRet=Regex.FindAll(sText,sPattern)
//-------------------------------------------------------------------------------
arrRet=Regex.FindAll("UiBot2022RPA123","[0-9]")
TracePrint(arrRet)