Regex parse issue
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi Am trying to achieve the attached. Please help why alteryx reading like this city brackets missing and "\" character also adding.
Solved! Go to Solution.
- Labels:
- Regex
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi!
I suspect your issue is around the fact that both \ and | are special characters in RegEx and need to be escaped in your formula. The below should work for your requirements:
REGEX_Replace([Id],'(.*\|)(.*)','$1') + [City]
(.*\|) - The brackets denote the first captured group, .* - zero or more of any character, up to and including |. Using the \ to escape the | special character so that Alteryx isn't recognising it as an OR function.
(.*) - Second caputed group, in this case everything after the |
Adding city in the function after the RegEx means you'll get the whole field rather as required and it wont be evaluated as part of the RegEx.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Happy to help : ) @sreejithmp
Cheers and have a nice day!
