Forum Discussion
Rajorigin
2 years agoExpert
Need help with Regex
Hi team, I want to include a set of users to an existing segment. This segment will be used for exclusions in all promotional campaigns. Let's call that segment as Level 3. The set of users are subs...
DavidO
2 years agoVisionary
Hey Rajorigin
I think I understand your need and my regex is not amazing but this might help get the conversation started.
o[a-z]{3,4}-\d{1,2}
Where 'o' is the lower case 'o', '[a-z]{3,4}' is looking for any sequence of 3 to 4 lowercase letters after the 'o' as it appears some users may have 3 and some may have 4. The '-' is just that, and the '\d{1, 2}' is looking for any one or two digit numbers on the end, as it looks like they could have 8, or 10 or probably other numbers.
So, you know, I built this by putting your question into CoPilot, which got me 95% there and then used Regex101 to test and debug what CoPilot gave me with your strings.
😊
Related Content
- 12 months ago
- 2 years ago