Find regex

i have data as “id” : “18382dqudu75 idia”.

from the above expression I wanted to extract the alpha number string which is – 18382dqudu75.

help with writing regex for the same.

thans

Hi @satish_kumar

Can you please confirm me the input string is it
id : 18382dqudu75 idia
Or
18382dqudu75 idia

Thanks.

If you want to fetch the alpha number as mentioned “18382dqudu75” from “18382dqudu75 idia” then you can simply extract it by using split
Ex- id.Split(" "c)(0)

But if you want to validate the string .Can you please provide more input sample so we will find the common pattern to validate the string with regex.

You can also try below if your pattern remains constant as you mentioned
\d{5}+[a-zA-Z]+\d{2}+

1 Like

give a try on
grafik

But this numbers and alphabets might change their places dynamically.

Hi @satish_kumar

Can you share the input

System.Text.RegularExpression.Regex.Match("InputString","\b\d+[a-z]+\d+").Tostring

image

Regards
Gokul

2 Likes

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