Fixed parse_tokens

The current implementation only works when a comment is at the very start of the query string. Elsewhere question marks inside comments were interpolated.

Also I optimized it to avoid compiling a new regexp on each invocation, since in 99.9% of cases it's always the same regexp.