RegExMatch.SubExpressionStartB

From Xojo Documentation

Method

RegExMatch.SubExpressionStartB(matchNumber as Integer) As Integer

Supported for all project types and targets.

Returns the starting byte offset of the SubExpression given by matchNumber. SubExpressionStartB is zero-based.

Notes

To convert this byte offset into a 1-based character position (for use with String functions such as Mid and Left), use this code:

Var m As MemoryBlock
m = theString
characterPosition = m.LeftB(aRegExMatch.SubExpressionStartB(matchNumber)).Len + 1