composer/composer — pull request #3380 by esenti (2014-10-29 15:28:17+00:00)
Title: Escape delimiter characters in BaseExcludeFilter.

When parsing .gitignore files, it's possible that the rule will contain a '#' character (eg. https://github.com/yiisoft/yii/blob/master/.gitignore#L37). As it's the same as the delimiter character, this will cause the built regexp to be invalid. To fix this issue, the '#' characters should be properly escaped.

I've found this issue when trying to setup Satis with the Yii package, which resulted in:

[ErrorException]
preg_match(): Unknown modifier '['