How to get the Required values form the string using regex expressions

Hi All i need the regex expression to get the Account Number an d the Value after the Account Number based on the length using Regex expression

"

@chandolusathi.kumar

Please try this in assign

Str_acctnum = System.Text.RegularExpressions.Regex.Match(str,"(?<=account number )\d{12}").Value

Str_nextnum = System.Text.RegularExpressions.Regex.Match(str,"(?<=account number \d{12} is )\d{7}").Value

Hope this helps

Cheers

i want the regex for getting individual ones

@chandolusathi.kumar

It is for individual ones only…first is for account number second is for the second number

Cheers

it is working thanks you so much

1 Like

@chandolusathi.kumar

Happy Automation

Please mark the solution and close the topic so that other can also get help

Cheers

sorry for wrong expression please look in the below mentioned string

@chandolusathi.kumar

Use this for the number between sba and submit

(?<=SBA-).*(?=Submit)

Expression remains same as in previous post.

Account number

(?<=account number\s*)\d{12}

Number after that

(?<=account number\s*\d{12}\s*is\s*)\d{7}

Cheers

Hi

i want the string is “means including SBA in the account number and the symbol “-” and after the string have the Numeric value

3 patterns is not working please revisit it again

@chandolusathi.kumar

Please try this

(?=SBA-).*(?=Submit)

Cheers

i want this string "

and the remaining two patterns also not working

@chandolusathi.kumar

Thats is what i procided above and all the patterns are working for fiven string…if the string is changing or casing is changing then use System.Text.RegularExpressions.Regex.Match(str,"(?<=account number\s*)\d{12}",regexoptions.IgnoreCase).Value

Cheers

for the first string we have to start form “SBA-” and after that it needs to starts from Numeric value and ends with Numeric and no special characters is present
for the remaining two strings need to starts numeric and ends with numeric and no characters and no special characters

please find the proper regex for the satisfying the above conditions

@chandolusathi.kumar

If you check the screenshot that is what is highlighted in each

Cheers