I got an IEnumberablle variable but I only want unique items. What to do? I tried
(my regex)(?<!\1[\s\S]\1) but this doesn’t work for me. Thanks
I am looping this regex result and putting all the items in a string but I only need unique values. I tried to use if statement for the assign, but won;t work
Hi, I’m not sure what the regex is doing because I’m fairly inexperienced, but I do know that error is because the variable you are using currently has a null value. You are trying to apply the .contains method to something which is nothing.
To initialize it you can either assign it an interim value (ie if its a string, you can assign “”), or if its a collection it will need to be something like ‘New list(of string)’ or whatever the syntax is for your particular variable type.
I agree with @KEntwistle. claimL is nothing the first time it hits that activity, so you need to either convert it to an empty string with .ToString (claimL.ToString.Contains()) or assign “” to the variable’s Default Value in the variables section.
Additionally, you can do lot of this manipulation using vb.net expression instead of using a For loop.
for example,
This is such an awesome tip :D! thanks a lot - Yes!! I’ve been trying to use more Assign activity like you do but have hard time coming up with the codes. I think using loops maybe slower? not sure… I will try to find some online course and study about vb.net and regex now. Thanks! ^^
Hi @lavint
Is your problem for duplication solved??
I am facing same issue and not getting any proper solution, below is the link
I tried using distinct, that doesn’t work.Also i tried to suffix (?<!\1[\s\S]\1) with my regex pattern, it throws error.
Please can you help me out with it.
My original pattern is “([\w]*/[\d]{1,2}-[\d]{1,2}-[\d]{2,3}-[\w]{4}/[\d]{1,2})"
and i want to extract only the distinct ones but it is even extracting the duplicate ones.