Hello,
I'm working on a project that requires me to use RegEx to retrieve data.
Situation:
The client has a Free Text column, and I need to get the data from there using RegEx based on specified terms.
The position of specific words in the column is not fixed.
I've included an example of the data.
Input | Output1 | output2 |
The Id contains ProtocolId 1001 and SiteId 2001 | 1001 | 2001 |
The Id contains SiteId 2002 and ProtocolId 1001 | 1001 | 2002 |
The Id contains ProtocolId 1001 and SiteId 2003 | 1001 | 2003 |
The Id contains ProtocolId 1001 and SiteId 2004 | 1001 | 2004 |
The Id contains ProtocolId 1001 and SiteId 2005 | 1001 | 2005 |
Please check and assist me to find the solution.
Please also include a sample workflow if possible.
Should be able to use this. If there's any drastic variations that may mess this up then let me know and can revisit:
(\d+)\D+(\d+)
If there'll only ever be 2 groups of numbers you're pulling out, then tokenize is a very safe option to. Using the following will just extract the 2 instances of a group of numbers:
Hello @DataNath ,
in my problem I have to fetch the data on the basis of ProtocolId and SiteId words because my column is free text so it taking other Numeric value as output.
Ex:-
Input:- ProtocolId 1001 and SiteId 2001
Output:- 1001 2001
Can you provide the solution on the basis of words
Hello @binuacs ,
If possible can you give the solution using the Specific word.
I just gonna try with the specific words approach.
Hello @binuacs and @DataNath ,
For both the approach its taking the first numeric available in Column.
But I want to fetch the data for ProtocolId and SiteId numeric values only.
So all the solution which is provided by you is not working in my case.
If possible kindly provide the solution using Specific words only.
@shashank_shukla the new solution I provided just above is correct against your expected outcome and is specific to the words in the right order.
The first RegEx tool extracts the numbers after 'ProtocolId' and ignores other:
The second then does the same for 'SiteId':