Please enable JavaScript to view this site.

 

str = getRegexResultString(sListResults, nMatchIndex, nGroupIndex)

 

This macro function is used after a call to the function StrFindRegex to obtain the strings corresponding to various matches obtained from that function.

 

nMatchIndex corresponds to the index of the Match found by the previous call to StrFindRegex. Recall that the result of the function StrFindRegex gives you the total number of matches.

nGroupIndex corresponds to the index of the capture group of the Match of index nMatchIndex found by the previous call to StrFindRegex.

// look for concatenated string of the form 09*†^§ø-18*†^§ø
sRegex = '([0-9]{2})([*†^§ø]{0,5})-([0-9]{2})([*†^§ø]{0,5})'
nNumRegexFound = StrFindRegex(sCurString, sRegex, sListRegexResults, true)
if nNumRegexFound == 1 // if current entry is a concatenated string
    sConcatMin = getRegexResultString(sListRegexResults, 11)
    sSymbolsMin = getRegexResultString(sListRegexResults, 12)
    sConcatMax = getRegexResultString(sListRegexResults, 13)
    sSymbolsMax = getRegexResultString(sListRegexResults, 14)
   // process these found values
   // ...
endif

See also: StrFindRegex, StrReplaceRegex, getRegexResultPosition.

 


Topic 188590, last updated on 23-Jun-2025