remove unused code

this also fixes the problem with a single quote occurring for example in a regex.
test included.