Hi Team,
I'm new to alteryx and was trying to parse data in a column "Task Name" using Regex but something seems to fail. This task name consists of many tasks aling with their material numbers . For Eg, In task name column which is shown below conists of tasks like "Assembly", "Approval" and material numbers like "1-1718647-1", "2314055-2" etc.
I wanted to parse "1-1718647-1", "2314055-2" material numbers out of these columns and want the output to be shown as below.
I used this regex expression "(^\d+\>\W\d+|\<\W\d\>)" to get the output but seems to fail.
Can anyone help on this?
Also, have attached excel file which has these columns for reference.
Task Name | RegexOut |
Assembly | |
Approval | |
1-1718647-1 Housing 2 Pos. | 1-1718647-1 |
1718654-1 Retainer 3 Pos. | 1718654-1 |
1-1802616-1 6 Pos. MCON | 1-1802616-1 |
1802572-1 Housing | 1802572-1 |
1-1802083-1 | 1-1802083-1 |
0-2366427-4 | 0-2366427-4 |
2314055-2 | 2314055-2 |
53P |
Solved! Go to Solution.
Hi @Bhargav
You can configure regex tool like below.
.*?\s?([\d-]*).*
Output:
Hope this helps 🙂
If this post helps you please mark it as solution. And give a like if you dont mind 😀👍
Hi atcodedog05,
Thanks for the quick solution .
The solution provided by you is working brillantly but I have modified the table now and have a new row.
When I use your regex expression , the last row which I have inputed now also seems to be coming as an output.
Can you check the table once more and provide me the solution?
Hi @Bhargav
Here is a updated workflow
I couldnt solve only with a regex. Please check whether it works.
Hope this helps 🙂
If this post helps you please mark it as solution. And give a like if you dont mind 😀👍
Hi ,
Thanks for the solution again.
Could you please take the sample file which I have attached and get me a solution because going is wrong when I apply your regex expression to the whole data.
Can you please check on the sample data I have attached?
Actually... This will capture the PRJ- that sometimes appears at the start,
((?:PRJ-)?[\d-]{5,})
Lot to learn from you @PhilipMannering 🙂