Link with the correct C++ library on Mac. Added a fix for allowing folder names with regex special characters