Returns the start location of the n captured sub-pattern.
| Category: | Regular Expression |
| Requirement: | The regular expression must contain sub-patterns that can be used to match patterns. |
| Returned data type: | Integer |
//Define some variables
string MyString
string MyString2
integer i
integer SSC
integer SSS
integer SSL
// Set initial values for variables
i = 0
SSS = 0
SSL = 0
SSC = 0
// Sample inpit string
MyString = "DataFlux Data Management Studio"
// Define a regular expression object
regex r
// Then compile it - notice the use of ( and )
r. compile("(DataFlux|DF) Data Management (Studio|Platform)")
// Find the first substring
if r.findfirst(MyString)
begin
// Use the "substring" functions to find the number of substrings
SSC = r.substringcount()
// Loop through substrings
for i = 1 to SSC
begin
// Then pull out substrings
SSS = r.substringstart(i)
SSL = r.substringlength(i)
MyString2 = mid(MyString,SSS,SSL)
// Place the substrings in a data row
pushrow()
end
end
// Terminate the expression node processing
seteof(true)
// Prevent the last pushrow() from showing up twice
return false