Dear Colleagues,
Please advise the best Formula or Regex expression for the case below.
I would like to remove everything which is after the last "/" but keep this character.
Input data:
John/Kovalsky/Green234&*@oj
Anna/2012305abd
Desire result:
John/Kovalsky/
Anna/
Thank you
Asia
Solved! Go to Solution.
The formula would be something like below
REGEX_Replace([Input], "(.*/)(.*)", "$1")
Regex always tries to fit in most of the characters in the initial pattern while maintaining the overall pattern. Hence all the chars before last / will be captured in first brackets(.*/). And we just need to replace the whole string with the first captured group.
Workflow:
Hope this helps : )
Thank you both for a quick help!
Asia
Happy to help : ) @joannasokolowska
Cheers and have a nice day!
Hi @joannasokolowska
Here is are some resources to learn more about Regex and marked groups.
https://community.alteryx.com/t5/Alteryx-Designer-Knowledge-Base/Tool-Mastery-RegEx/ta-p/37689
https://community.alteryx.com/t5/Interactive-Lessons/Parsing-Data-with-RegEx/ta-p/441415
Hope this helps : )