I am really new to regular expression. Can you please tell me what will be regular expression to finde Amazon fees in following string. so it give me list of float.
private static List<float> GetAmazonFees(string text)
{
//Regular expression to fine list of fees
}
.
Order ID: 102-8960168-7248227
Please ship this order using Standard shipping.
Ship by: 12/19/2012
Item: Ridata 8GB Class 10 SDHC Card - Secure Digital High Capacity -
Lightening Series - RDSDHC8G-LIG10
Condition: New
Condition note: This item is sealed and brand new! SHIPS IN ONE BUSINESS DAY
Listing ID: 1213M39KPDB
SKU: 7S-5JMI-HO98
Quantity: 1
Order date: 12/17/2012
Price: $8.60
Amazon fees: -$1.14
Shipping: $4.49
Your earnings: $11.95Ship by: 12/19/2012Item: RiDATA Lightning Series 16GB Secure Digital High-Capacity (SDHC)Condition: NewCondition note: This item is sealed and brand new! SHIPS IN ONE BUSINESS DAYListing ID: 1204MRSEY95SKU: HJ-EYF8-EZVRQuantity: 1Order date: 12/17/2012Price: $15.97Amazon fees: -$1.78Shipping: $4.99Your earnings: $19.18- - - - - - - - - - - - - - - - - - -NEXT STEPS FOR THIS ORDER:1) Print the packing slip:Log into your seller account and go to the Order Details page for thisorder: https://www.amazon.com/manageorderdetails?orderID=102-8960168-7248227.Click "Print order packing slip" next to the order number at the top of thepage.2) Buy shipping (optional):You may ship the item using any carrier and method you prefer. Want toavoid a trip to the post office? Click "Buy shipping" at the bottom of theOrder Detail page to purchase and print shipping labels from your home oroffice. Delivery confirmation is also available. To learn more, search"shipping" in seller Help.3) Confirm shipment:Click "Confirm shipment" at the bottom of the Order Detail page and entershipping details. Once confirmed, we'll charge the buyer, notify them theirorder has shipped, and transfer the order payment into your seller account.To lea
This is fairly straightforward. The regex you need will be something like
Amazon fees: (\-?)\$(\d+\.?\d*)\D.So using this we can do:
This gets us the list of all matches. We then process it out for the floats:
I capture the negative, although we could assume all fee’s are negative I’d rather check for it and return the correct negative float.
I think this should give you what you want. I’m overlooking a lot of error checking here, but you get the idea.