Jen Dobry.
It was possibly a typo in the book - there are often many.
You want the whole address, but this regex is only picking out the part between the '@' sign and '.xxx' of the suffix.
It all depends on where you put the parenthesis in a regex, as to what gets returned.
I've re-positioned the parens '(' and ')' to inlude the whole mail address.
$akapity[$i] = preg_replace('/([^@s]+@[-a-z0-9]+.+[a-z]{2,})/i','<a href="mailto:$1">$1</a>',$akapity[$i]);