RegEx of string

Hello,

i want to reg exp of given string:

  1. 310.00/1-KG

  2. 93,000.00

Thanks
Minal Patil

Hi @minal.patil
Can you explain your question in details?

what is the regulars expression of given strings:

  1. 310.00/1-KG
  2. 93,000.00

I want to regulars expression to find the above strings.

HI @minal.patil

Can you tell us the expected output?

How about this expression? If you need to get all the string if so you can try with this one.

System.Text.RegularExpressions.Regex.Match(YourString,"\d.*").Tostring

image

Regards
Gokul

not all string?

String: -
Item Material Description Unit Dispatch Date
Order Qty Price per unit Net value Vendor Mat. No


00010 309X185 LOSARTAN POTASSIUM KG 93,000.00 08/03/2020
300.000 310.00/1-KG

To find:------

1st out put is:

  1. 310.00/1-KG

2nd output is:
2. 93,000.00

yes i tell expected output?

Use this code to extract the second output

Pattern Code: \d{1,3},\d{3}.\d{2}

image

Thanks!!!

HI @minal.patil

Can you try like this?

Split(YourInputString," ").Last

Output -> "310.00/1-KG"
Split(YourInputString," ")(split(YourInputString," ").count-4)

Output -> "93,000.00"

image

Thanks it is solved

i want to using reg exp. because i scrap pdf into TXT format. after that i want to expected output.

Hi @minal.patil

To getting 1st output use this pattern : \b\d{3}.\d{2}/1-KG\b$

To getting 2nd output use this pattern : \d{1,3},\d{3}.\d{2}

Thanks!!!

thanks for help
but in 1st string KG value is not fix

@minal.patil
Check my last post screenshots. It extracted both value correctly.
Try this : \d{1,3},\d{3}.\d{2} | \b\d{3}.\d{2}/1-KG\b$

Thanks!!!

value are dynamically change

eg. :

4103.050/2-FH

Hi @minal.patil

Try this pattern now: \d{1,3},\d{3}.\d{2} | ([^\s]+)/(.*)

Sample Output
image

I hope it will work in your case. Mark it as solution if it works
Thanks!!!


not solve

input string:

Item Material Description Unit Dispatch Date
Order Qty Price per unit Net value Vendor Mat. No


00010 309X185 LOSARTAN POTASSIUM KG 08/03/2020
300.000 310.00/1-KG 93,000.00

00010 309X185 xxxxxxx xyxzyxs KG 08/03/2020
300.000 4103.050/2-FH 93,000.00

i want to output as below:

  1. 310.00/1-KG and 4103.050/2-FH
  2. 93,000.00 and 93,000.00