Expand regexp responsible for libraries detecting

This fixes #336