Use expression Regular for extract values .help me please

How can I get only the values of the fields id , name, country. using regular .net expressions? I hope your support please. Thank you

Hi @Jeanpierren96,

Can you provide the above text mentioned.

1 Like

Hi, this is the string “Client ID: TD88219\r\nClient Name: Caroll Eisenmann\r\nClient Country: Romania” . Thanks

To extract Client ID

(?<=Client ID: )(.+)(?=\r\nClient Name)
To extract Client Name

(?<=Client Name: )(.+)(?=\r\nClient Country)
To extract Country

(?<=Client Country: )(.+)

3 Likes

If \r\n is part of the string and not newline characters, then you will need to adjust this with a double backslash, so it considers the slash as a character.

(?<=Client ID: )(.+)(?=\\r\\nClient Name)

2 Likes

Yes you are absolutely right, but when i am writing here, it removing the backslash, that’s why i have given the reference to regex101.com

2 Likes

Many thanks to both, they solved my problem. It works with just one for some reason when it comes to comments Clayton gives me null. Thanks for contributing to the community, greetings from Peru. A hug.

Sorry mi english not is very well

Thank very much , a hug. Great Job.

I think it gave you null because the \r\n in your string is a newline character. By adding the double slash, it forces it to look for \r\n as a string rather than a newline character. So, I was just making that suggestion in case it was not a newline character.

Regards.

1 Like

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