How to get specific text from Input using Regex

Hello,

I am trying to get only specific text from text file. I have amount & Currency and from that want to get only currency by skipping amount, because amount will get’s change for each file.

Below is the expression.
A számla végösszege: 12 065.00EUR

from above want to get EUR.

I have tried with (?<=A számla végösszege:\s+)\S+\s+\w+\W+\w+
but getting entire string

Hi @nilesh.mahajan
Try this
image

Hi @nilesh.mahajan

Try using the below regex expression

Hope it works!!

Hi @nilesh.mahajan

How about this pattern:

(?<=A számla végösszege:\s)([\d\s.]+[A-Z]{3})

image

Hope this helps,
Best Regards.

Hi @nilesh.mahajan

Please try below one “(?<=\d)[A-Z]+”

image

HI @nilesh.mahajan

How about this Regular expression?

System.Text.RegularExpressions.Regex.Match(YourString,"[A-Z]+$").Tostring

image

Regards
Gokul

Hi @nilesh.mahajan

Input_Text = “A számla végösszege: 12 065.00EUR”
Try this first Regex : (?<=A számla végösszege: ).*
To get the output is “12 065.00EUR”

Input_Text = “12 065.00EUR”
Try this Second Regex : [A-Za-z]+
To get the output is “EUR”

I hope it’s work all the scenario.

Regards
@Sathya_Vani_R

I got the correct Pattern. Thanks for your reply.

(?<=A számla végösszege:\s+\d+\s\d+\W\w\w)\S+

image

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