Fixing issues with regex