How to get the Account number from the string using regular Expression

please find the above string i need the account number from the above string using regular expression

kindly help me with regular expression

@chandolusathi.kumar You can use this Regex reger this Link just change regex pattern to \d{12}

@chandolusathi.kumar

Please try this expression \d+(?=Personal)

I hope personal is always available after the account number

If account is also present then

(?<=A/C - )\d+(?=Personal)

Use this match activity

Or directly with system.text.regularexpressions.regex.match("your atring","(?<=A/C - )\d+(?=Personal)").Value

Cheers

Hi,

How about the following?

System.Text.RegularExpressions.Regex.Match(yourString,"(?<=A/C\D+)\d+").Value

Regards,

i need full expression could you please help me with that

@chandolusathi.kumar

This is the full expression

system.text.regularexpressions.regex.match("your atring","(?<=A/C - )\d+(?=Personal)").Value

The output is of string type

Cheers

i need the user na

i need the same scenario for the following string

kindly help me with

kindly help me to get the account number, account holder name and Mobile number and Email ID and IFSC Code and Communication Address as well kindly help me @Yoic

@chandolusathi.kumar

Accnt num - (?<=Account number)\d+(?=Account holder)

Acc hlder - (?<=name).*(?=Fsc)

Mob num - (?<=Mobile number)\d+(?=Email)

Email - (?<=ID).*(?=0o)

Use with same expression provided above

Cheers

Hi,

FYI, Another approach using regex named group.

m = System.Text.RegularExpressions.Regex.Match(yourString,"Account number(?<ACCOUNTNUMBER>\d+)Account holder’s name(?<ACCOUNTHOLDER>.*?)Fsc.*?Mobile number(?<MOBILENUMBER>.*?)Email-ID(?<EMAILID>.*)0o View")

Then

m.Groups("ACCOUNTNUMBER").Value
m.Groups("ACCOUNTHOLDER").Value
m.Groups("MOBILENUMBER").Value
m.Groups("EMAILID").Value

Sample20230120-1aL.zip (2.6 KB)

Regards,

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