How to avoid alphanumeric and pick only numeric using regex

Hi Team,

I have alphanumeric and number details but i want to pick only numeric if alphanumeric present should avoid pick only numeric please help me anyone for this.

Number digit count is 11, that is static only

Input:
jsdhjshvf hfkjdl23445 jsvbjfbv
jdgscsdh 12345654567 jhdvsbjsfv

Output:
12345654567

Regards,
Raja G

Hi,

Can you try the following expression?

System.Text.RegularExpressions.Regex.Match(yourString,"\b\d+\b").Value

Regards,

1 Like

HI @Raja.G

Checkout this expression

System.Text.Regex.RegularExpression.Match(YourString,"(?<=\S\s)\d+(?=\s\S)").Tostring

image

Regards
Sudharsan

1 Like

Hi @Sudharsan_Ka and @Yoichi ,

Thanks guys , working fine

1 Like

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