Extract the Net Amount after the 10 digit number

hai

i need to get 10 digit number after the Net AMount] using regesx

I THIS IS A CONFIRMATION OF OUR CARD PAYMENT I
[Invoice Number Customer Account/ Comment PO Number Date Due Date Amount Discount Net Amount]
1716510480 Comment: 9497 6/1/2019 7/10/2019 $20.77 $0.00 $20.77
Total: $20.77
Please charge a total of $20.77 to MasterCard
Card Number: 5567660649214363 Expires: 08/2019
CCV: 345
Cardholder Name: NVoicePay, Card Holder Company
Name: NVoicePay
Billing Address: 8905 SW Nimbus Avenue Suite 240,
Beaverton, OR 97008

  • IMPORTANT:
    C) nvomepay , , ,
    If you require the security code, please contact the customer directly.
    If you have other questions please call Vendor Services at 877.626.6332.
    If you are changing your payment email address or bank account, please email

System.Text.RegularExpressions.Regex.Replace(PdfText,?<=Net Amount][\S\s]).{10})

i got error also

If this is always the first 10 digit number in your string (it looks like) you can simply use Matches activity. As a pattern specify “\d{10}”. As a result you will get a collection of all 10 digits numbers from your string. The match with index 0 will be the first one.

The other approach is to get all ten digits between net amount and comment anchors with pattern
(?<=Net Amount]\n)(\d{10})(?=\sComment)

It looks like there is a new line after “Amount]”

thanks for your quick replay but i got only empty string

@veera_g In assign activity use regular expression like this

PdfText = System.Text.RegularExpressions.Regex.Match(PdfText,"(\d){10}").Value

Now print PdfText and check what values you are getting

yep am getting answer 1716469307 this is am expected and i need one small thing

in the below more than one 10 digit numbers i want to reject is there any idea

PHILADELPHIA, PA 19178-3531
Accounts Receivable Department:
THIS IS A CONFIRMATION OF OUR CARD PAYMENT
Invoice Number Customer Account / Comment PO Number Date Due Date Amount Discount Net Amount
1716469307 Comment: SUBARU 6/5/2019 7/5/2019 $1,598.00 $0.00 $1,598.00
1716482490 Comment: MAZDA 6/5/2019 7/5/2019 $2,000.00 $0.00 $2,000.00
1716492267 Comment: VW 6/5/2019 7/5/2019 $799.47 $0.00 $799.47
1716574858 Comment: ACURA 6/5/2019 7/5/2019 $999.00 $0.00 $999.00
77029678-1 Comment: VW 3/31/2019 4/30/2019 $355.91 $0.00 $355.91
Total:
$5,752.38
Please charge a total of $5,752.38 to MasterCard

@veera_g Can you specify the example of the output from the string

1716469307 Comment: SUBARU 6/5/2019 7/5/2019 $1,598.00 $0.00 $1,598.00
1716482490 Comment: MAZDA 6/5/2019 7/5/2019 $2,000.00 $0.00 $2,000.00
1716492267 Comment: VW 6/5/2019 7/5/2019 $799.47 $0.00 $799.47
1716574858 Comment: ACURA 6/5/2019 7/5/2019 $999.00 $0.00 $999.00
77029678-1 Comment: VW 3/31/2019 4/30/2019 $355.91 $0.00 $355.91

above is my input if am using regex i got 10 number 1716469307 its ok for me but in next line its also contains another 10 digit number if the suitation i want to reject this invoice

You can use the Matches activity for with the RegEx
(\d*\-?\d*)\sComment
This should return a list of matches.
If Count of list > 1 Then Reject

1716510480 Comment: 9497 6/1/2019 7/10/2019 $20.77 $0.00 $20.77
Total: $20.77

Hai i need to extract the 9497 number in after comment
could u please tell me the regex options

For that particular string: you can use (?<=\bComment:\s)(\d){4}

This will look for the parttern 'Comment: ’ and get the 4 digits after it.

I recommend learning some Regex as it gets more compliated the more information you need to extract