Great module brucey!
One thing i miss though, is access to submatches within a replace.
Heres a simple adition to TRegex.Replace for it =)
One thing i miss though, is access to submatches within a replace.
Heres a simple adition to TRegex.Replace for it =)
' if there wasn't an error... process the match (even for no-match) While result >= 0 Or result = REGEX_NOMATCH '----->> Local replaceStr:String = replaceWith Local ofs:Int Ptr = Int Ptr(offsets) For Local i:Int = 0 To result Local idx:Int = i * 2 replaceStr = replaceStr.Replace( "" + i, lastTarget[ofs[idx]..ofs[idx+1]]) Next '-----<< If result > 0 Then ' add text so far, and the replacement retString:+ lastTarget[startPos..Int Ptr(offsets)[0]] + replaceStr '<---