Add bool conversion to fix potential bug.

Binary operations promote to int, which means that the comparisons here
are not guaranteed to do what the code is meant to do. Explicitly
converting the result of the bit-wise and means that the comparison is
guaranteed to work.
Fix memory leaks in the way pcre is used.
Remove additional string copy from QByteArray.

Don't leak the string that defines the regex and since QByteArray's are
null terminated and contiguous in memory, we don't need to copy them.