<div dir="ltr"><div>this doesn't work:</div><div><br></div>/tmp/toybox$ echo "a1234b" | grep -o [0-9]*<br>1234<br>/tmp/toybox$ echo "a1234b" | ./toybox grep -o [0-9]*<br>/tmp/toybox$ <br><div><br></div><div>but this does:</div><div><br></div><div>/tmp/toybox$ ./toybox grep -o version /proc/version <br>version<br>version<br><br></div><div>as does:</div><div><br></div><div>/tmp/toybox$ echo "1234b" | ./toybox grep -o [0-9]*<br>1234<br></div><div><br></div><div>it seems wrong that there's arithmetic on rm_so/rm_eo before the call to regexec0() (which will clobber both), and it does seem like the problem is that we're not getting the right results in rm_so/rm_eo on exit from regexec0(), but i failed to work out why...</div></div>