Skip to main content
I am a new for the regex, so can any good people can help me answer these question? thanks....

this is my email:

Order Number: 2000157

Date Ordered: Wednesday, May 21, 2014

http://www.ggfoee.com/orderdetails.aspx?orderid=2000157

Link to Back End Order Details   

CUSTOMER ROLE: Parent 

PAYMENT METHOD: PayPal Standard 

PAYMENT STATUS: Pending 

PO URL:  No Purchase Order File Uploaded 

PO  ⌗: 

COUPON CODE:  No coupon used 

No Comment or Instructions Given

Billing Address

Name: lacy mason

Company: Mason Tool & Engineering Ltd

Address: Unit 8/ 66 Hobill Ave,

Wiri

City: Auckland, 2241

State/Province: North Island, Ireland

Phone: 021735562

My question is:

How to use regex get those info?: Date ordered, Payment Method, Payment Status, Name, company name, Address and Phone number.

you don't need answer all, just answer what you know it. thank you again...:)
1 answer
  1. Apr 20, 2015, 5:02 AM
    Hi You may use below code snippet to find things like :

    Pattern datePatt = Pattern.compile("(Date Ordered:)(.*)(http:)"); ... Matcher m = datePatt.matcher(dateStr); if (m.matches()) { String date = (m.group(2) };

    and so on, but you email needs to be exactly in this same format, so that you may find the starting and ending strings.

     
0/9000