Use preg_quote instead of home made replacement to quote string for preg

Signed-off-by: Michal Čihař <michal@cihar.com>