$re = '/\(UID \d+ FLAGS \((?<FLAGS>.*)\) INTERNALDATE "(?<INTERNALDATE>.*)" RFC822\.SIZE (?<SIZE>\d+) ENVELOPE \((?<ENVELOPE>.*)\) BODY \((?<BODY>.*)\)\)/m';
$str = '* 1 FETCH (UID 1 FLAGS (\\Seen) INTERNALDATE "10-Mar-2016 22:41:20 +0000" RFC822.SIZE 24187 ENVELOPE ("Thu, 10 Mar 2016 14:40:39 -0800" "New Site TWR" (("Nicola Finch" NIL "onearth" "lincsat.com")) (("Nicola Finch" NIL "onearth" "lincsat.com")) (("Nicola Finch" NIL "onearth" "lincsat.com")) ((NIL NIL "kevin" "ecms.io")) (("Kevin Farley" NIL "kevin" "barrens.ca")) NIL NIL "<009501d17b1d$f404d340$dc0e79c0$@lincsat.com>") BODY (("text" "plain" ("charset" "us-ascii") NIL NIL "7bit" 3479 139)("text" "html" ("charset" "us-ascii") NIL NIL "quoted-printable" 17560 342) "alternative"))
* 2 FETCH (UID 2 FLAGS (\\Answered \\Seen) INTERNALDATE "15-Mar-2016 23:58:14 +0000" RFC822.SIZE 154295 ENVELOPE ("Tue, 15 Mar 2016 16:57:10 -0700" "From Nicola (touch wood)" (("Nicola Finch" NIL "onearth" "lincsat.com")) (("Nicola Finch" NIL "onearth" "lincsat.com")) (("Nicola Finch" NIL "onearth" "lincsat.com")) ((NIL NIL "kevin" "ecms.io")) (("Kevin Farley" NIL "kevin" "barrens.ca")) NIL NIL "<003c01d17f16$7a685140$6f38f3c0$@lincsat.com>") BODY ((("text" "plain" ("charset" "us-ascii") NIL NIL "7bit" 647 23)("text" "html" ("charset" "us-ascii") NIL NIL "quoted-printable" 4319 102) "alternative")("image" "jpeg" ("name" "image001.jpg") "" NIL "base64" 145770) "related"))
* 3 FETCH (UID 3 FLAGS (\\Seen NonJunk) INTERNALDATE "10-Apr-2016 15:15:56 +0000" RFC822.SIZE 387794 ENVELOPE ("Sun, 10 Apr 2016 11:15:46 -0400" "REVISION to price lists" (("GSA Spirits" NIL "jan" "gsaspirits.com")) (("GSA Spirits" NIL "jan" "gsaspirits.com")) (("GSA Spirits" NIL "jan" "gsaspirits.com")) NIL NIL NIL NIL "<57BA5443-8119-4902-B9B5-CE08183285AA@gsaspirits.com>") BODY (("text" "plain" ("charset" "us-ascii") NIL NIL "quoted-printable" 338 17)(("text" "html" ("charset" "us-ascii") NIL NIL "quoted-printable" 5619 85)("application" "pdf" ("x-unix-mode" "0644" "name" "Blackadder.pdf") NIL NIL "base64" 118916)("text" "html" ("charset" "us-ascii") NIL NIL "7bit" 400 0)("application" "pdf" ("x-unix-mode" "0644" "name" "Edradour.pdf") NIL NIL "base64" 79218)("text" "html" ("charset" "us-ascii") NIL NIL "7bit" 400 0)("application" "pdf" ("x-unix-mode" "0644" "name" "Signatory Vintage.pdf") NIL NIL "base64" 178902)("text" "html" ("charset" "us-ascii") NIL NIL "7bit" 417 2) "mixed") "alternative"))
* 4 FETCH (UID 4 FLAGS (\\Seen NonJunk) INTERNALDATE "12-Apr-2016 05:17:50 +0000" RFC822.SIZE 2894160 ENVELOPE ("Tue, 12 Apr 2016 01:17:18 -0400" "muskoka flood petition to get the water down" (("Balamo Conservation Corporation" NIL "balamocc" "gmail.com")) (("Balamo Conservation Corporation" NIL "balamocc" "gmail.com")) (("Balamo Conservation Corporation" NIL "balamocc" "gmail.com")) (("TML Councillors and Mayor" NIL "TMLcouncillorsmayor" "rogers.com")("DMM Councillors" NIL "districtcouncillors311" "muskoka.on.ca")("bala merchants & residents" NIL "balamerchantsetal" "rogers.com")("Michael Hart Pres M.L.A." NIL "mla1hart" "aol.com")("MRA Directors" NIL "directors" "muskokaratepayers.ca")("MRA attn Liz Denyar" NIL "muskokaratepayers" "vianet.ca")("torrance merchants & residents" NIL "torrancemerchants&res" "rogers.com")("TML C of C board members & GM" NIL "mlcofcboard" "rogers.com")("minister MNRF bill mauro" NIL "minister.mnr" "ontario.ca")("MNRF PS Dist Mgr Dan Duggan" NIL "dan.duggan" "ontario.ca")("MNRF Anne Collins" NIL "anne.collins" "ontario.ca")("mactier merchants & res" NIL "mactiermerchsetal" "rogers.com")("wahta mohawks including senior administrator K. Commandant" NIL "wahtamohawks" "rogers.com")("port carling merchants & res" NIL "pcmerchsetal" "rogers.com")("bracebridge merchants & res" NIL "bracebridgemerchsetal" "rogers.com")) (("gravenhurst merchs & res" NIL "gravenhurstmerchsetal" "rogers.com")("Muskoka Tourism Board Members" NIL "MTMA311" "muskoka.com")("Huntsville Merchants & res" NIL "huntsvillemerchtsres" "rogers.com")("Rosseau merchs and res" NIL "rosseaumerchsres" "rogers.com")("parry sound merchants & res" NIL "psmerchsetal" "rogers.com")("catherine Nasmith Pres ACO, Ontario" NIL "ns1catherine" "aol.com")("walkers point residents" NIL "walkerspointresidents" "rogers.com")("PNP cottagers residents" NIL "pnpcottagersresidents" "rogers.com")("MP Tony Clement" NIL "Clement.T" "parl.gc.ca")("mpp norm miller" NIL "norm.miller" "pc.ola.org")) ((NIL NIL "kevin" "barrens.ca")) NIL "") BODY ((("text" "plain" ("charset" "UTF-8") NIL NIL "quoted-printable" 774 25)("text" "html" ("charset" "UTF-8") NIL NIL "quoted-printable" 4437 82) "alternative")("application" "octet-stream" ("name" "FLOOD 2016 PINE NEEDLE POINT LAKE MUSKOKA.jpg") NIL NIL "base64" 2883314) "mixed"))
* 5 FETCH (UID 5 FLAGS (\\Seen NonJunk) INTERNALDATE "14-Apr-2016 15:52:57 +0000" RFC822.SIZE 387796 ENVELOPE ("Thu, 14 Apr 2016 11:52:42 -0400" Scotch Order Reminder (("GSA Spirits" NIL "jan" "gsaspirits.com")) (("GSA Spirits" NIL "jan" "gsaspirits.com")) (("GSA Spirits" NIL "jan" "gsaspirits.com")) NIL NIL NIL NIL "<300492E2-6E2A-4B20-9315-6838EE7BE12B@gsaspirits.com>") BODY (("text" "plain" ("charset" "utf-8") NIL NIL "quoted-printable" 346 17)(("text" "html" ("charset" "utf-8") NIL NIL "quoted-printable" 5618 85)("application" "pdf" ("x-unix-mode" "0644" "name" "Blackadder.pdf") NIL NIL "base64" 118916)("text" "html" ("charset" "us-ascii") NIL NIL "7bit" 397 0)("application" "pdf" ("x-unix-mode" "0644" "name" "Edradour.pdf") NIL NIL "base64" 79218)("text" "html" ("charset" "us-ascii") NIL NIL "7bit" 397 0)("application" "pdf" ("x-unix-mode" "0644" "name" "Signatory Vintage.pdf") NIL NIL "base64" 178902)("text" "html" ("charset" "us-ascii") NIL NIL "7bit" 414 2) "mixed") "alternative"))
* 6 FETCH (UID 6 FLAGS (\\Seen NonJunk) INTERNALDATE "21-Apr-2016 16:37:43 +0000" RFC822.SIZE 115955 ENVELOPE ("Thu, 21 Apr 2016 12:37:20 -0400" "Emailing: MLA Water Level media release Apr 20 2016" (("Balamo Conservation Corporation" NIL "balamocc" "gmail.com")) (("Balamo Conservation Corporation" NIL "balamocc" "gmail.com")) (("Balamo Conservation Corporation" NIL "balamocc" "gmail.com")) (("bala merchants & residents" NIL "balamerchantsetal" "rogers.com")("wahta mohawks including senior administrator K. Commandant" NIL "wahtamohawks" "rogers.com")("torrance merchants & residents" NIL "torrancemerchants&res" "rogers.com")("mactier merchants & res" NIL "mactiermerchsetal" "rogers.com")("port carling merchants & res" NIL "pcmerchsetal" "rogers.com")("bracebridge merchants & res" NIL "bracebridgemerchsetal" "rogers.com")("Huntsville Merchants & res" NIL "huntsvillemerchtsres" "rogers.com")("gravenhurst merchs & res" NIL "gravenhurstmerchsetal" "rogers.com")("walkers point residents" NIL "walkerspointresidents" "rogers.com")("PNP cottagers residents" NIL "pnpcottagersresidents" "rogers.com")) (("Premier Wynne con Exec Asst/Off Mgr aafaaq shaikh" NIL "kwynne.mpp.co" "liberal.ola.org")("MP Tony Clement" NIL "Clement.T" "parl.gc.ca")("MP DV West Rob Oliphant" NIL "rob.oliphant" "parl.gc.ca")) ((NIL NIL "kevin" "barrens.ca")) NIL "") BODY ((("text" "plain" ("charset" "UTF-8") NIL NIL "quoted-printable" 526 18)("text" "html" ("charset" "UTF-8") NIL NIL "quoted-printable" 2080 41) "alternative")("application" "pdf" ("name" "MLA Water Level media release Apr 20 2016.pdf") NIL NIL "base64" 108346) "mixed"))
* 7 FETCH (UID 7 FLAGS (\\Seen NonJunk) INTERNALDATE "21-Apr-2016 17:54:33 +0000" RFC822.SIZE 10046 ENVELOPE ("Thu, 21 Apr 2016 13:54:30 -0400" "Re: Yonge St S" (("Bob Stone" NIL "bobstonexx" "gmail.com")) (("Bob Stone" NIL "bobstonexx" "gmail.com")) (("Bob Stone" NIL "bobstonexx" "gmail.com")) ((NIL NIL "kevin" "barrens.ca")) NIL NIL "<20160421160107.CD1DE1777CB@relay1.esolutionsgroup.ca>" "<98BF5417-E6CA-4C16-B80B-6648CD8F5C53@gmail.com>") BODY (("text" "plain" ("charset" "windows-1252") NIL NIL "quoted-printable" 1698 44)("text" "html" ("charset" "windows-1252") NIL NIL "quoted-printable" 4082 62) "alternative"))
* 8 FETCH (UID 8 FLAGS (\\Seen) INTERNALDATE "27-Apr-2016 17:33:04 +0000" RFC822.SIZE 19674 ENVELOPE ("Wed, 27 Apr 2016 10:32:51 -0700" "Your payment to Ontario Disc Sports Association" (("service@intl.paypal.com" NIL "service" "intl.paypal.com")) (("service@intl.paypal.com" NIL "service" "intl.paypal.com")) (("service@intl.paypal.com" NIL "service" "intl.paypal.com")) (("Kevin Farley" NIL "kevin" "barrens.ca")) NIL NIL NIL "<1461778371.1018@paypal.com>") BODY (("text" "plain" ("charset" "UTF-8") NIL NIL "base64" 3426 47)("text" "html" ("charset" "UTF-8") NIL NIL "base64" 13908 188) "alternative"))
* 9 FETCH (UID 9 FLAGS (\\Answered \\Seen NonJunk) INTERNALDATE "28-Apr-2016 05:03:41 +0000" RFC822.SIZE 3069 ENVELOPE ("Wed, 27 Apr 2016 22:03:38 -0700 (PDT)" "Thank You for Registering for the Black Fly Fling" (("Chris Shier" NIL "shier10" "hotmail.com")) (("Chris Shier" NIL "shier10" "hotmail.com")) ((NIL NIL "shier10" "hotmail.com")) ((NIL NIL "kevin" "barrens.ca")) NIL NIL NIL "") BODY ("text" "plain" ("charset" "UTF-8") NIL NIL "7bit" 199 7))
* 10 FETCH (UID 10 FLAGS (\\Seen) INTERNALDATE "28-Apr-2016 05:05:15 +0000" RFC822.SIZE 19849 ENVELOPE ("Wed, 27 Apr 2016 22:05:03 -0700" "Your payment to Chris Shier- Disc Golf Tournament Director" (("service@intl.paypal.com" NIL "service" "intl.paypal.com")) (("service@intl.paypal.com" NIL "service" "intl.paypal.com")) (("service@intl.paypal.com" NIL "service" "intl.paypal.com")) (("Kevin Farley" NIL "kevin" "barrens.ca")) NIL NIL NIL "<1461819903.17653@paypal.com>") BODY (("text" "plain" ("charset" "UTF-8") NIL NIL "base64" 3446 47)("text" "html" ("charset" "UTF-8") NIL NIL "base64" 13930 189) "alternative"))
* 11 FETCH (UID 11 FLAGS (\\Seen) INTERNALDATE "07-May-2016 11:32:09 +0000" RFC822.SIZE 15668 ENVELOPE ("Sat, 07 May 2016 11:32:05 +0000" {54}
Re: Thanks for your Disc Golf club memberships in ODSA (("Chris Ozolins" NIL "chris" "ondisc.org")) (("Chris Ozolins" NIL "chris" "ondisc.org")) (("Chris Ozolins" NIL "chris" "ondisc.org")) (("Kevin Farley" NIL "kevin" "barrens.ca")) NIL NIL NIL "") BODY (("text" "plain" ("charset" "utf-8") NIL NIL "quoted-printable" 3813 103)("text" "html" ("charset" "utf-8") NIL NIL "quoted-printable" 9244 177) "alternative"))
* 12 FETCH (UID 12 FLAGS (\\Seen) INTERNALDATE "12-May-2016 19:27:23 +0000" RFC822.SIZE 14091 ENVELOPE ("Thu, 12 May 2016 15:27:20 -0400" "Confirmation email for processed transaction." ((NIL NIL "kevin" "ecms.io")) ((NIL NIL "kevin" "ecms.io")) ((NIL NIL "kevin" "ecms.io")) (("Kevin Farley" NIL "kevin" "barrens.ca")) NIL NIL NIL NIL) BODY (("text" "plain" ("charset" "7bit") NIL NIL "quoted-printable" 891 12)("text" "html" ("charset" "UTF-8") NIL NIL "7bit" 11098 76) "alternative"))
* 13 FETCH (UID 13 FLAGS (\\Seen) INTERNALDATE "12-May-2016 19:40:41 +0000" RFC822.SIZE 24971 ENVELOPE ("Thu, 12 May 2016 15:40:38 -0400" "Welcome to Bronze Membership, Kevin!" ((NIL NIL "kevin" "ecms.io")) ((NIL NIL "kevin" "ecms.io")) ((NIL NIL "kevin" "ecms.io")) (("Kevin Farley" NIL "kevin" "barrens.ca")) NIL NIL NIL NIL) BODY (("text" "plain" ("charset" "7bit") NIL NIL "quoted-printable" 4110 55)("text" "html" ("charset" "UTF-8") NIL NIL "7bit" 18747 94) "alternative"))
* 14 FETCH (UID 14 FLAGS (\\Seen) INTERNALDATE "12-May-2016 19:40:42 +0000" RFC822.SIZE 13147 ENVELOPE ("Thu, 12 May 2016 15:40:40 -0400" "Confirmation email for processed payment on existing invoice." ((NIL NIL "kevin" "ecms.io")) ((NIL NIL "kevin" "ecms.io")) ((NIL NIL "kevin" "ecms.io")) (("Kevin Farley" NIL "kevin" "barrens.ca")) NIL NIL NIL NIL) BODY (("text" "plain" ("charset" "7bit") NIL NIL "quoted-printable" 968 13)("text" "html" ("charset" "UTF-8") NIL NIL "7bit" 10063 67) "alternative"))
* 15 FETCH (UID 15 FLAGS (\\Seen) INTERNALDATE "12-May-2016 20:38:07 +0000" RFC822.SIZE 13880 ENVELOPE ("Thu, 12 May 2016 16:38:05 -0400" "Confirmation email for processed transaction." ((NIL NIL "kevin" "ecms.io")) ((NIL NIL "kevin" "ecms.io")) ((NIL NIL "kevin" "ecms.io")) (("Kevin Farley" NIL "kevin" "barrens.ca")) NIL NIL NIL NIL) BODY (("text" "plain" ("charset" "7bit") NIL NIL "quoted-printable" 884 12)("text" "html" ("charset" "UTF-8") NIL NIL "7bit" 10892 75) "alternative"))
* 16 FETCH (UID 16 FLAGS (\\Seen NonJunk) INTERNALDATE "14-May-2016 16:19:49 +0000" RFC822.SIZE 645998 ENVELOPE ("Sat, 14 May 2016 12:19:45 -0400" "Black Fly Fling Player Information Package" (("Chris Shier" NIL "shier10" "hotmail.com")) (("Chris Shier" NIL "shier10" "hotmail.com")) (("Chris Shier" NIL "shier10" "hotmail.com")) NIL NIL NIL NIL "") BODY ((("text" "plain" ("charset" "iso-8859-1") NIL NIL "quoted-printable" 642 11)("text" "html" ("charset" "iso-8859-1") NIL NIL "quoted-printable" 966 26) "alternative")("application" "pdf" NIL NIL NIL "base64" 641764) "mixed"))
* 17 FETCH (UID 17 FLAGS (\\Answered \\Seen NonJunk) INTERNALDATE "16-May-2016 19:46:09 +0000" RFC822.SIZE 11039 ENVELOPE ("Mon, 16 May 2016 15:46:04 -0400" "Re: Yonge St S" (("Bob Stone" NIL "bobstonexx" "gmail.com")) (("Bob Stone" NIL "bobstonexx" "gmail.com")) (("Bob Stone" NIL "bobstonexx" "gmail.com")) ((NIL NIL "kevin" "barrens.ca")) NIL NIL "<20160421160107.CD1DE1777CB@relay1.esolutionsgroup.ca>" "<15291B6E-64E0-4ED3-9D24-08555912ECB7@gmail.com>") BODY (("text" "plain" ("charset" "windows-1252") NIL NIL "quoted-printable" 1848 48)("text" "html" ("charset" "windows-1252") NIL NIL "quoted-printable" 4922 73) "alternative"))
* 18 FETCH (UID 18 FLAGS (\\Seen) INTERNALDATE "29-May-2016 15:29:50 +0000" RFC822.SIZE 130824 ENVELOPE ("Sun, 29 May 2016 11:29:42 -0400" "Recital Tickets" (("Jacqueline Farley" NIL "jackie" "ecms.io")) (("Jacqueline Farley" NIL "jackie" "ecms.io")) ((NIL NIL "jackie" "ecms.io")) ((NIL NIL "kevin" "barrens.ca")) NIL NIL NIL "<39ef40f5-6529-4749-037d-84f60f5012c3@ecms.io>") BODY ((("text" "plain" ("charset" "utf-8" "format" "flowed") NIL NIL "7bit" 261 17)(("text" "html" ("charset" "utf-8") NIL NIL "7bit" 1968 49)("image" "gif" ("name" "ojhmokmgbbdkmmag.gif") "" NIL "base64" 11276) "related") "alternative")("application" "pdf" ("name" "tickets (3) (1).pdf") NIL NIL "base64" 112862) "mixed"))
* 19 FETCH (UID 19 FLAGS (\\Seen NonJunk) INTERNALDATE "01-Jun-2016 16:54:34 +0000" RFC822.SIZE 18077 ENVELOPE ("Wed, 1 Jun 2016 12:54:32 -0400 (EDT)" "Reminder: Ontario car insurance rates just dropped!" (("The Lowest Rates Team" NIL "info" "lowestrates.email")) ((NIL NIL "mailer" "infusionmail.com")) (("The Lowest Rates Team" NIL "info" "lowestrates.email")) ((NIL NIL "kevin" "barrens.ca")) NIL NIL NIL "<1535672484.1343451464800072503.JavaMail.tomcat@phxcw4>") BODY (("text" "plain" ("charset" "utf-8") NIL NIL "8bit" 383 7)("text" "html" ("charset" "utf-8") NIL NIL "8bit" 15130 261) "alternative"))
* 20 FETCH (UID 20 FLAGS (\\Answered \\Seen) INTERNALDATE "01-Jun-2016 20:01:17 +0000" RFC822.SIZE 63716 ENVELOPE ("Wed, 1 Jun 2016 20:01:13 +0000" "RE: Auto quote" (("Wendy Bossence" NIL "wendy.bossence.qxm8" "statefarm.com")) (("Wendy Bossence" NIL "wendy.bossence.qxm8" "statefarm.com")) (("Wendy Bossence" NIL "wendy.bossence.qxm8" "statefarm.com")) (("KEVIN@BARRENS.CA" NIL "KEVIN" "BARRENS.CA")) NIL NIL "" "<5CC46A4110FA61438C5FC101BC5F425824A9255C@WPSDGQGD.OPR.STATEFARM.ORG>") BODY (("text" "plain" ("charset" "utf-8") NIL NIL "base64" 13438 173)("text" "html" ("charset" "utf-8") NIL NIL "base64" 46086 591) "alternative"))
* 21 FETCH (UID 21 FLAGS (\\Seen) INTERNALDATE "03-Jun-2016 01:16:17 +0000" RFC822.SIZE 4850 ENVELOPE ("Thu, 02 Jun 2016 21:17:57 -0400" {34}
Fwd: Black Sails : Fact or Fiction (("Jacqueline Farley" NIL "jackie" "barrens.ca")) (("Jacqueline Farley" NIL "jackie" "barrens.ca")) (("Jacqueline Farley" NIL "jackie" "barrens.ca")) (("Kevin Farley" NIL "kevin" "barrens.ca")) NIL NIL "" "") BODY (("text" "plain" ("charset" "UTF-8") NIL NIL "8bit" 439 13)("text" "html" ("charset" "utf-8") NIL NIL "8bit" 883 13) "alternative"))
* 22 FETCH (UID 22 FLAGS (\\Seen) INTERNALDATE "23-Jun-2016 19:49:26 +0000" RFC822.SIZE 64303 ENVELOPE ("Thu, 23 Jun 2016 19:49:25 +0000" "=?utf-8?Q?Exclusive=20offer=21=20Best=20rates=20this=20summer=20at=20Clevelands=20House?=" (("=?utf-8?Q?Muskoka=20Tourism?=" NIL "info" "muskokatourism.ca")) (("Muskoka Tourism" NIL "info=muskokatourism.ca" "mail30.wdc01.mcdlv.net")) (("=?utf-8?Q?Muskoka=20Tourism?=" NIL "info" "muskokatourism.ca")) ((NIL NIL "kevin" "barrens.ca")) NIL NIL NIL "") BODY (("text" "plain" ("charset" "utf-8" "format" "fixed") NIL NIL "quoted-printable" 3030 62)("text" "html" ("charset" "utf-8") NIL NIL "quoted-printable" 58013 1316) "alternative"))
* 23 FETCH (UID 23 FLAGS (\\Answered \\Seen NonJunk $label3) INTERNALDATE "04-Jul-2016 21:12:05 +0000" RFC822.SIZE 18195 ENVELOPE ("Mon, 4 Jul 2016 17:12:04 -0400" {82}
RE: Request a quote (Epson PowerLite Home Cinema 5030UB projector FullHD 3D 1080p) (("Richard Desjardins" NIL "richard" "quebecacoustic.com")) (("Richard Desjardins" NIL "richard" "quebecacoustic.com")) (("Richard Desjardins" NIL "richard" "quebecacoustic.com")) (("Kevin Farley" NIL "kevin" "barrens.ca")) NIL NIL "" "<046B370B7DE8514B977FF287BF6BCBCB0148FE50F0F3@QASERVER1.qacoustic.local>") BODY (("text" "plain" ("charset" "utf-8") NIL NIL "base64" 1660 22)("text" "html" ("charset" "utf-8") NIL NIL "base64" 13758 177) "alternative"))
* 24 FETCH (UID 24 FLAGS (\\Seen NonJunk) INTERNALDATE "05-Jul-2016 15:36:32 +0000" RFC822.SIZE 9960 ENVELOPE ("Tue, 05 Jul 2016 11:36:30 -0400" "You can get big money out of politics" (("Amy Watson, Green Party of Ontario" NIL "amywatson" "gpo.ca")) (("Amy Watson, Green Party of Ontario" NIL "amywatson" "gpo.ca")) (("Amy Watson, Green Party of Ontario" NIL "amywatson" "gpo.ca")) (("Kevin Farley" NIL "kevin" "barrens.ca")) NIL NIL NIL "<20160705153631.1C222CA8194@civismtp.uas.coop>") BODY (("text" "plain" ("charset" "utf-8") NIL NIL "8bit" 3349 85)("text" "html" ("charset" "utf-8") NIL NIL "8bit" 4767 60) "alternative"))
* 25 FETCH (UID 25 FLAGS (\\Seen $label3) INTERNALDATE "05-Jul-2016 23:10:45 +0000" RFC822.SIZE 34958 ENVELOPE ("Tue, 5 Jul 2016 19:10:42 -0400" {82}
RE: Request a quote (Epson PowerLite Home Cinema 5030UB projector FullHD 3D 1080p) (("Richard Desjardins" NIL "richard" "quebecacoustic.com")) (("Richard Desjardins" NIL "richard" "quebecacoustic.com")) (("Richard Desjardins" NIL "richard" "quebecacoustic.com")) (("Kevin Farley" NIL "kevin" "barrens.ca")) NIL NIL "<9e93217e-89b8-3d1a-c35a-4ceb33398519@barrens.ca>" "<046B370B7DE8514B977FF287BF6BCBCB0148FE50F107@QASERVER1.qacoustic.local>") BODY (("text" "plain" ("charset" "utf-8") NIL NIL "base64" 5226 67)("text" "html" ("charset" "utf-8") NIL NIL "base64" 26838 345) "alternative"))
* 26 FETCH (UID 26 FLAGS (\\Seen NonJunk) INTERNALDATE "06-Jul-2016 13:43:12 +0000" RFC822.SIZE 19788 ENVELOPE ("Wed, 6 Jul 2016 13:43:09 +0000" "Eastporters : Price request for Epson 5030UB PowerLite Home Cinema 1080P 3D Home Theater Projector" (("Eastporters Audio Video" NIL "sales" "eastporters.com")) (("Eastporters Audio Video" NIL "sales" "eastporters.com")) ((NIL NIL "sales" "eastporters.com")) ((NIL NIL "kevin" "barrens.ca")) NIL NIL NIL "<62fee33070cbfcb4599d530b644c5e73@www.eastporters.com>") BODY (("text" "plain" ("charset" "us-ascii") NIL NIL "7bit" 428 16)("text" "html" ("charset" "us-ascii") NIL NIL "7bit" 15064 288) "alternative"))';
preg_match_all($re, $str, $matches, PREG_SET_ORDER, 0);
// Print the entire match result
var_dump($matches);
Please keep in mind that these code samples are automatically generated and are not guaranteed to work. If you find any syntax errors, feel free to submit a bug report. For a full regex reference for PHP, please visit: http://php.net/manual/en/ref.pcre.php