From ad65577a228fd6c6d3448805186fa10b8a145d1a Mon Sep 17 00:00:00 2001 From: Michail Ovchinnikov Date: Tue, 18 Jan 2022 13:55:13 +0300 Subject: [PATCH] fix color name generation --- FigmaAssetsFetch/Helpers/StringExtensions.swift | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/FigmaAssetsFetch/Helpers/StringExtensions.swift b/FigmaAssetsFetch/Helpers/StringExtensions.swift index 4de21d4..80ff600 100644 --- a/FigmaAssetsFetch/Helpers/StringExtensions.swift +++ b/FigmaAssetsFetch/Helpers/StringExtensions.swift @@ -10,8 +10,11 @@ extension String { } var stripped: String { - let okayChars = Set("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLKMNOPQRSTUVWXYZ1234567890 ") - return filter { okayChars.contains($0) } + return replacingOccurrences( + of: "[^\\w]", + with: " ", + options: .regularExpression + ) } var camelCased: String {