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
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
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}+
give a try on
But this numbers and alphabets might change their places dynamically.
Can you share the input
System.Text.RegularExpression.Regex.Match("InputString","\b\d+[a-z]+\d+").Tostring
Regards
Gokul
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.