issue with pattern matching

i have 2 strings with values below which are read from a file

1 ---> end
2 ---> string(1)newline="\n";

which need to be compared inside an if block as below

if [ ${LAST_1_LINE} == "end" -a ${LAST_2_LINE} == "string\(\1\)newline\=\"\\n\"\;" ]
then
  echo "pattern match"
fi

but the above code is not working

Hi, use strong quoting on the string with the funny characters and weak quoting for the variable references..

if [ "$LAST_1_LINE" = end ] && [ "$LAST_2_LINE" = 'string(1)newline="\n";' ]; then