RegEx: Separate the string to extract particular portion

Hi
I have an array of 4 strings to be separated. I need to extract the second column and remove its first 2 characters.

Thanks in advance

Hi @james_g,
can you please provide some sample inputs, showcasing all the possibilities?

2 Likes

Hi

Sure
The input will be like
10000abcd BJ123456 1020 3040

The output should be
123456,
without BJ in the second term.

Thank you

Hi @james_g,

I think I will be able to help you with this task. Please give a try with this RegEx.

(?<=^\d[\w]+\s[\w][\w])\w+

It will be able to give you the desired output.

Thanks

2 Likes

@james_g aybe regex can help:
grafik

Thanks

Let me try

This works for the given input.
But when the input is like
10000abcd BJab23456 1020 3040, after the first 2 char in the 2nd term, the following 2 char will also be omitted.

Thanks for your response

This works pretty well for all the combinations.

Thank you

1 Like

You are right. So its important for us to know also the variations. as an alternate have a look here:
grafik

grafik

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