I just fixed a bug in one of my scripts. Apparently the eol character really is not just the ‘$’ sign. Instead you have to do something like
if (preg_match("/customer_[0-9]+\.[php|html|shtml]+$/iD", $item)) {
That uppercase ‘D’ is important. It’s documented here
http://www.php.net/manual/en/reference.pcre.pattern.modifiers.php