Make regex more forgiving for assignment

Closes #1110 and #1120