I have a data set that has a column with junk data surrounding the data I need.
Example: RS345, WIhihdh, 19-999878 or
D124, 18-878789 RT2A
I need to keep only the 19-000989 or the 18-878789. I need to create a string expression that will look for xx-xxxxxx and create a new column for this data.
I'm trying to use the multi-row formula tool I'm struggling with the string expression. Any advice would be appreciated.
Solved! Go to Solution.
this works like a charm! thank you so much
Hi Blake,
Thank you for your solution I found it very helpful as well. However, in my case the field may contain the same pattern .*(\d{2}-\d{6}).* more than once and I would like every instance of the pattern parsed/returned. How would I change the expression to account for multiple instances?
Thanks
Hey @AshleenKenney
I'm glad the previous solution helped you!
If you have multiple IDs in the fields, you can parse each one out by using the tokenize method rather than parse.
If you have a variable number of IDs, I would recommend putting a RecordID right before your Regex tool and parsing to rows. This will put each ID on a separate line but let you know which record it came from.
If you have a static number of IDs, you can just select that number of columns to parse to.
I've attached a sample canvas to this comment, let me know if it works for you!