Fixing bug in RegEx back reference implementation.

\0 is null character and it was being handled as backreference.