Regex method

hello

i want get the price of Per diem in the below given example.

$1.3 for Per Diem
6/Per Diem
For each Per Diem $2

how can i get from regex or any orher method

Hi @T_Y_Raju ,

Maybe we can first check with a Normal number/currency regex, then let’s restrict it based on how you actually get the data :

[\d\.,]+

Expression :

System.Text.RegularExpressions.Regex.Match(yourInputStr,"[\d\.,]+").Value.Trim

Let us know if this is able to get your data or if it matches also any other extra numbers present in the input.

Hi @T_Y_Raju

Check out this Regular expression

System.Text.RegularExpressions.Regex.Match(Yourstring,"\$[\d.,]+|[\d.,]+").Value.Trim

image

Regards
Gokul

“ABC $50 day and Per Diem is approx. of $20 per day”
“ABC $50 day”
“Per Diem is approx. of $20 per day”
“Per Diem is approx. of $20 per day and ABC $50 day”

i want ABC price and Per Deim price from 4 different strings in regex

@T_Y_Raju

for ABC - System.Text.RegularExpressions.Regex.Match(str,"(?<=ABC\D+)\d+").Value

for Per Dim - System.Text.RegularExpressions.Regex.Match(str,"(?<=Per Diem\D+)\d+").Value

Hope this helps

Cheers

how can i check value in message box

can you send me the screen shot how value is getting in message box

for ABC - System.Text.RegularExpressions.Regex.Match(str,"(?<=ABC\D+)\d+").Value

whre i have to write this expression

@T_Y_Raju

Paste this expression as is in the message box…and str is the string variable containing your string

Hope this helps

Cheers

image

@T_Y_Raju

I dont see system.text etc there…and can you show the error please…without that we cant understand what is wrong

Cheers

Please add this also

Cheers