C
C#16mo ago
breakfast

Is Regex overkill for ~2000 strings and a few conditions?

Goal: My input is a list of usernames returned from an API that only contain alphanumerics and underscores. Conditionally I'd like to only break the string apart only the first time any of these conditions are met: 1. Encounter a literal "_" 2. Encounter an upper case after a lower case 3. Encounter an upper case after an upper case. Is Regex kinda overkill or simply not the "right" tool for this or am I in the right ballpark? I figure I could also use string.Replace or break the strings down and do Char comparisons then compare the results.
3 Replies
ChucklesTheBeard
ChucklesTheBeard16mo ago
regex seems like the perfect tool for this job
Unknown User
Unknown User16mo ago
Message Not Public
Sign In & Join Server To View
breakfast
breakfastOP16mo ago
Cool, thanks you two.
Want results from more Discord servers?
Add your server