Unable to split string using matches

Above is the syntax, right?

Take a look at your starting text below

Arun Kumar (aa15)A, - I dont think this is LN, FN(UN) …

That’s why i asked

I am searching by using lastname,firstname
ex. Kumar,arun for this there are so many results.
as mentioned A,Arun Kumar(aa15)A,Arun Kumar(aa17) because this names also contains Kumar,arun.
so i wanted to split A,Arun Kumar(aa15)A,Arun Kumar(aa17) this text only because results are like that .
Output i want as i mention excel pic.
yes lastname,firstname(username) this is syntax wanted to spilt after each username
Arun Kumar (aa15)A, - I dont think this is LN, FN(UN) … ?? --i want A,Arun Kumar (aa15) i single line not Arun Kumar (aa15)A,

@Mathkar_kunal - Got it…One more question…I see your pattern in the given text

FN (UN)LN - Right?

Arun Kumar (aa15)A, Arun Kumar (aa2)A, Arun Kumar (aa8)Bellamkonda, Arun Kumar (abellamk)Biswal, Aruna Kumar (abiswal)Chettupally, Arun kumar (achettup)Jeyakumar, Arun Kumar (ajeyakum)K, Arun Kumar (ak5)

See the bolded one …It is missing the last name? you agree?

A, Arun Kumar (aa2)A, Arun Kumar (aa8)Bellamkonda, Arun Kumar (abellamk)Biswal, Aruna Kumar (abiswal)Chettupally, Arun kumar (achettup)Jeyakumar, Arun Kumar (ajeyakum)K, Arun Kumar (ak5)

i guess now u can understand what i want to say
lastname,firstname(username)
K, Arun Kumar (ak5)

@Mathkar_kunal - I am really sorry…I am still got confused… Whatever you shared below is following a perfect pattern…

A, Arun Kumar (aa2)A, Arun Kumar (aa8)Bellamkonda, Arun Kumar (abellamk)Biswal, Aruna Kumar (abiswal)Chettupally, Arun kumar (achettup)Jeyakumar, Arun Kumar (ajeyakum) K, Arun Kumar (ak5)

But this below is not…

Arun Kumar (aa15)A, Arun Kumar (aa2)A, Arun Kumar (aa8)Bellamkonda, Arun Kumar (abellamk)Biswal, Aruna Kumar (abiswal)Chettupally, Arun kumar (achettup)Jeyakumar, Arun Kumar (ajeyakum)K, Arun Kumar (ak5)

I am so close to the writing the output…pls see here…and look at the groups $1 $2 $3…it is perfectly splitting $1 = FN $2=UN $3=LN…

yes , correct u got it

ok, i will write this to excel and share it in a min.

sure, this kind of o/p i want
output

check this also u can understand
op

@Mathkar_kunal - Here you go…

XAML Image:

For each set up:

Write Line → “Match is: " +Item.groups(3).tostring +”," + Item.groups(1).tostring + Item.groups(2).tostring

Write Cell:

Output:

image

Please try as per the images, i purposely did not share the xaml because you can practice in this way.

Here is the Regex post

2 Likes

sure, i will try and thanks for the help

1 Like

@Mathkar_kunal - Did you get a chance to try? if yes, and it works… please mark my post as solution and that will close this thread and also people can find solution in this post. Thanks…

I tried some permutaion combination as per my understanding but didnt work for me

@Mathkar_kunal - permutation combination???

Either share your xaml or post clear input text …

I have already provided perfect regex for whatever text you posted and I wrote the output and shared it too…

Can you tell me what is full regex because in ur provided pic i can abl to see this only (\W+\S+\W+\S .
can you help me to understand what is group here in item.group(3).tostring?

@Mathkar_kunal…thats my bad I didn’t provide the pattern in my post . Sorry. Let me do it in a min.

hi @Mathkar_kunal… here is the regex pattern…

https://regex101.com/r/V6tuxP/1

Click the above link and you see on your right hand side you can see the groups like below

As per your requirements, you asked your output should be LN, FN (UN) right? So it is group3, group1 (group2)

One More Thing: Idx in For each is default to 0…So in the Write cell, I have used “A” + (idx+2).tostring…So it will write from cell A2.

If you still facing issues, i will share the xaml.

Thanks for the solution. worked for me.

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.