[CHANGE] adding support for all possible lineendings so $ and ^ always match \n \r \r\n and unicode lineendings