I have to get each network nodes global title number range using regex

I have to get each network nodes global title number range using regex

Ex : in attachment image there are three global title number , the i have to each number like 30 94 , 30 694, 30 685585

thanks
shaik

Hi,
Can you try the following sample?

strTarget = System.Text.RegularExpressions.Regex.Match(strData,"(?<=Network\s*Nodes\s*Global\s*Title\s*Number\s*Range.*\r?\n)[\s\S]+?(?=\r?\n\r?\n|$)").Value

Sample
Sample20240215-2a.zip (2.9 KB)

Regards,

please guide @Yoichi

thanks
shaik

Hi @shaik.muktharvalli1 ,

I think your variable is having null value in your regex

Regards,
Vinit Mhatre

Could you please share me the value which you are storing into “StrGlobalTItle” variable

System.Text.RegularExpressions.Regex.Match( StrGlobalTitle,“(?<=Network\sNodes\sGlobal\sTitle\sNumber\sRange.\r?\n)[\s\S]+?(?=\r?\n\r?\n|$)”).Value

Thank you @Yoichi it’s working fine

If Global title range
like… 30 654 00000000 9999999 MNO
30 65474 00000000 9999999 MNO
then I have to get only first two numbers
like … 30 654
30 65474
please give me solution

Thanks
Shaik

HI,

How about the following regex pattern?

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

Regards,

working fine

thank you once again @Yoichi :hugs:

Thanks
Shaik

1 Like

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