ZF2-43: Zend\Translator tests fail because of unescaped regex


This looks like a regression that was introduced in commit 8e34a0ea0f33ca, now in master branch.

It seems that the pattern used to create the RegexIterator is not being escaped properly, so for example if $ignore is '/.' (which is probably the most common value), the regex will be '//./u' which is invalid.

This breaks the tests, and I get for example:

37) ZendTest\Translator\TranslatorTest::testSettingLogPriorityForLog
InvalidArgumentException: RecursiveRegexIterator::__construct(): Unknown modifier '.'



This is a naive attempt to fix the problem that works for me. Hopefully it is good enough.

This patch breaks 36 tests in my environment. It seems to be a Win-nix problem.

Fixed with GH-358