Modified regex for mac