Skip to content

Commit d5c818a

Browse files
committed
Fixed issue with the last string in result being incorrect in some cases
1 parent c9647f4 commit d5c818a

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

StringRegExpSplit.au3

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ Func StringRegExpSplit($sString, $sPattern, $iLimit = 0, $iFlags = $PREG_SPLIT_N
2828
If StringLen($aMatches[0]) = 0 Then $iOffset += 1
2929
WEnd
3030

31-
$sValue = StringMid($sString, $iOffset)
31+
$sValue = StringMid($sString, $iPrevOffset)
3232
If (Not BitAND($PREG_SPLIT_NO_EMPTY, $iFlags)) Or (Not $sValue == "") Then
3333
ReDim $aReturn[UBound($aReturn, 1) + 1]
3434
$aReturn[UBound($aReturn, 1) - 1] = $sValue

0 commit comments

Comments
 (0)