Fix end block parsing

Was only matching end elements which had letters only, need to match
letters and digits

closes #1439