const regex = /[-]{14}[0-9]+[\s].+[\s]+.+(?:[\s]*)([\s\S]*)[\s]{3}[-]{14}[0-9]+[\r\n]/;
// Alternative syntax using RegExp constructor
// const regex = new RegExp('[-]{14}[0-9]+[\\s].+[\\s]+.+(?:[\\s]*)([\\s\\S]*)[\\s]{3}[-]{14}[0-9]+[\\r\\n]', '')
const str = `Return-Path: <crown@noflem.date>
Delivered-To: me@finlaydag33k.nl
Received: from web01.01d.eu
by web01.01d.eu with LMTP
id UKmwFM5cels9EAAAfNQSUA
(envelope-from <crown@noflem.date>)
for <me@finlaydag33k.nl>; Mon, 20 Aug 2018 08:16:46 +0200
Return-path: <crown@noflem.date>
Envelope-to: me@finlaydag33k.nl
Delivery-date: Mon, 20 Aug 2018 08:16:46 +0200
Received: from mail by web01.01d.eu with spam-scanned (Exim 4.91)
(envelope-from <crown@noflem.date>)
id 1frdUb-0001AC-CB
for me@finlaydag33k.nl; Mon, 20 Aug 2018 08:16:46 +0200
X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on web01.01d.eu
X-Spam-Level: ****
X-Spam-Status: No, score=4.5 required=5.0 tests=FROMSPACE,
HTML_FONT_LOW_CONTRAST,HTML_MESSAGE,RDNS_NONE,T_REMOTE_IMAGE autolearn=no
autolearn_force=no version=3.4.1
Received: from [107.174.30.3] (helo=noflem.date)
by web01.01d.eu with esmtp (Exim 4.91)
(envelope-from <crown@noflem.date>)
id 1frdUZ-00019H-Eg
for me@finlaydag33k.nl; Mon, 20 Aug 2018 08:16:45 +0200
From: " Roderick" <crown@noflem.date>
Date: Mon, 20 Aug 2018 01:09:47 -0500
MIME-Version: 1.0
Subject: Are you a good pilot? Want to become one?
To: <me@finlaydag33k.nl>
Message-ID: <28mfPO16iDxTxnPJ_jT4Dib_DlNAQCDEUhRyp96JUTE.NNYAMLzX6-vdM1DDpnOXYdmLgAmcdkEMIV3WWEEeguk@noflem.date>
Content-Type: multipart/alternative;
boundary="------------008794531541259352341780"
ReverseDNS: No reverse DNS for mailserver at 107.174.30.3, +100 Spam score
SPFCheck: Server passes SPF test, -30 Spam score
SpamTally: Final spam score: 70
X-Antivirus-Scanner: Clean mail though you should still use an Antivirus
This is a multi-part message in MIME format.
--------------008794531541259352341780
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
The Game All Flight Fans Have Been Waiting For Is Finally Here...
<http://www.noflem.date/hkeja/swdecr31drvszty/uMiFCMuWqsqv30RUTjAE6Px2MB44CIYCV-1tGaeRefo/WM6pQxTIkSftU5DtI4wCcP0IycM12PFvPUSfrri_ihbttbluOqtE5Iw2qrONQYsKQHByoiINfeymEqrejohHX8wTJ0bjDXyONZolZHjl0g1pQ3tPccZYHRj_FFS_5jpO>The World's Most Realstic Flight Sim
<http://www.noflem.date/hkeja/swdecr31drvszty/uMiFCMuWqsqv30RUTjAE6Px2MB44CIYCV-1tGaeRefo/WM6pQxTIkSftU5DtI4wCcP0IycM12PFvPUSfrri_ihbttbluOqtE5Iw2qrONQYsKQHByoiINfeymEqrejohHX8wTJ0bjDXyONZolZHjl0g1pQ3tPccZYHRj_FFS_5jpO>
Watch The Amazing Video Demo Below:
<http://www.noflem.date/hkeja/swdecr31drvszty/uMiFCMuWqsqv30RUTjAE6Px2MB44CIYCV-1tGaeRefo/WM6pQxTIkSftU5DtI4wCcP0IycM12PFvPUSfrri_ihbttbluOqtE5Iw2qrONQYsKQHByoiINfeymEqrejohHX8wTJ0bjDXyONZolZHjl0g1pQ3tPccZYHRj_FFS_5jpO>
==>Fly Over 200+ Different Aircraft==>Real Controls Based on Real Cockpits!
<http://www.noflem.date/hkeja/swdecr31drvszty/uMiFCMuWqsqv30RUTjAE6Px2MB44CIYCV-1tGaeRefo/WM6pQxTIkSftU5DtI4wCcP0IycM12PFvPUSfrri_ihbttbluOqtE5Iw2qrONQYsKQHByoiINfeymEqrejohHX8wTJ0bjDXyONZolZHjl0g1pQ3tPccZYHRj_FFS_5jpO>==>Land Anywhere Worldswide With 25,000 Airport!==>Real World Instrument Behaviour==>Changable, Unpredictable Real-Time Weather
Fasten Your Seatbelts & Prepare To Take Flight!
<http://www.noflem.date/hkeja/swdecr31drvszty/uMiFCMuWqsqv30RUTjAE6Px2MB44CIYCV-1tGaeRefo/WM6pQxTIkSftU5DtI4wCcP0IycM12PFvPUSfrri_ihbttbluOqtE5Iw2qrONQYsKQHByoiINfeymEqrejohHX8wTJ0bjDXyONZolZHjl0g1pQ3tPccZYHRj_FFS_5jpO>
You can be asked to be removed by going here
<http://www.noflem.date/jfoqqvn/Opj5_SFF_jRHYZccPt3Qp1g0ljHZloZNOyXDjb0JTw8XHhojerqEmyefNIioyBHQKsYQNOrq2wI5EtqOulbttbhi_irrfSUPvFP21McyI0PcCw4ItD5UtfSkITxQp6MW.ofeReaGt1-VCYIC44BM2xP6EAjTUR03vqsqWuMCFiMu>or write to us below
<!--td {border: 1px solid #ccc;}br {mso-data-placement:same-cell;}-->265 S. Schoolhouse St. Boynton Beach, FL 33435ing
--------------008794531541259352341780
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
</head>
<body>
<center>
<table font-size:="" helvetica="" style="box-sizing: inherit; color: rgb(119, 119, 119); font-family: " width="600px">
<tbody style="box-sizing: inherit;">
<tr style="box-sizing: inherit;">
<td align="left" style="box-sizing: inherit;">
<div style="box-sizing: inherit; padding: 8px; border-radius: 10px;">
<center style="box-sizing: inherit;">
<div style="box-sizing: inherit; font-size: 19px;"><b style="box-sizing: inherit;"><a href="http://www.noflem.date/hkeja/swdecr31drvszty/uMiFCMuWqsqv30RUTjAE6Px2MB44CIYCV-1tGaeRefo/WM6pQxTIkSftU5DtI4wCcP0IycM12PFvPUSfrri_ihbttbluOqtE5Iw2qrONQYsKQHByoiINfeymEqrejohHX8wTJ0bjDXyONZolZHjl0g1pQ3tPccZYHRj_FFS_5jpO" rel="nofollow" style="box-sizing: inherit; text-decoration-line: none; color: red;" target="_blank">The Game All Flight Fans Have Been Waiting For Is Finally Here...</a><br style="box-sizing: inherit;" />
<a href="http://www.noflem.date/hkeja/swdecr31drvszty/uMiFCMuWqsqv30RUTjAE6Px2MB44CIYCV-1tGaeRefo/WM6pQxTIkSftU5DtI4wCcP0IycM12PFvPUSfrri_ihbttbluOqtE5Iw2qrONQYsKQHByoiINfeymEqrejohHX8wTJ0bjDXyONZolZHjl0g1pQ3tPccZYHRj_FFS_5jpO" rel="nofollow" style="box-sizing: inherit; text-decoration-line: none; color: black;" target="_blank">The World's Most Realstic Flight Sim</a></b></div>
</center>
<hr style="box-sizing: inherit; width: 310px; border-width: 3px; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-color: rgb(0, 176, 0);" />
<center style="box-sizing: inherit; font-size: 22px; background-color: rgb(254, 253, 53);"><strong style="box-sizing: inherit;"><a href="http://www.noflem.date/hkeja/swdecr31drvszty/uMiFCMuWqsqv30RUTjAE6Px2MB44CIYCV-1tGaeRefo/WM6pQxTIkSftU5DtI4wCcP0IycM12PFvPUSfrri_ihbttbluOqtE5Iw2qrONQYsKQHByoiINfeymEqrejohHX8wTJ0bjDXyONZolZHjl0g1pQ3tPccZYHRj_FFS_5jpO" rel="nofollow" style="box-sizing: inherit; text-decoration-line: none; color: rgb(65, 82, 73);" target="_blank"><span style="box-sizing: inherit; color: rgb(255, 0, 0);">Watch The Amazing Video Demo Below:</span></a></strong></center>
<div style="box-sizing: inherit; font-size: 19px;">==>Fly Over 200+ Different Aircraft<br style="box-sizing: inherit;" />
<br style="box-sizing: inherit;" />
==>Real Controls Based on Real Cockpits!<br style="box-sizing: inherit;" />
<center style="box-sizing: inherit;"><a href="http://www.noflem.date/hkeja/swdecr31drvszty/uMiFCMuWqsqv30RUTjAE6Px2MB44CIYCV-1tGaeRefo/WM6pQxTIkSftU5DtI4wCcP0IycM12PFvPUSfrri_ihbttbluOqtE5Iw2qrONQYsKQHByoiINfeymEqrejohHX8wTJ0bjDXyONZolZHjl0g1pQ3tPccZYHRj_FFS_5jpO" rel="nofollow" style="box-sizing: inherit; text-decoration-line: none; color: rgb(66, 133, 245);" target="_blank"><img alt="vp3flight" src="http://www.noflem.date/plane_flight.jpg" style="box-sizing: inherit;" /></a></center>
<br style="box-sizing: inherit;" />
==>Land Anywhere Worldswide With 25,000 Airport!<br style="box-sizing: inherit;" />
<br style="box-sizing: inherit;" />
==>Real World Instrument Behaviour<br style="box-sizing: inherit;" />
<br style="box-sizing: inherit;" />
==>Changable, Unpredictable Real-Time Weather</div>
<center style="box-sizing: inherit;">
<div style="box-sizing: inherit; font-size: 19px; background-color: rgb(55, 102, 144); padding: 8px; border-radius: 15px;"><span style="box-sizing: inherit; font-size: 22px;"><b style="box-sizing: inherit;"><a href="http://www.noflem.date/hkeja/swdecr31drvszty/uMiFCMuWqsqv30RUTjAE6Px2MB44CIYCV-1tGaeRefo/WM6pQxTIkSftU5DtI4wCcP0IycM12PFvPUSfrri_ihbttbluOqtE5Iw2qrONQYsKQHByoiINfeymEqrejohHX8wTJ0bjDXyONZolZHjl0g1pQ3tPccZYHRj_FFS_5jpO" rel="nofollow" style="box-sizing: inherit; text-decoration-line: none; color: rgb(255, 255, 255);" target="_blank">Fasten Your Seatbelts & Prepare To Take Flight!</a></b></span></div><br />
<img src="http://www.noflem.date/Mfqs4im7f/uMiFCMuWqsqv30RUTjAE6Px2MB44CIYCV-1tGaeRefo/WM6pQxTIkSftU5DtI4wCcP0IycM12PFvPUSfrri_ihbttbluOqtE5Iw2qrONQYsKQHByoiINfeymEqrejohHX8wTJ0bjDXyONZolZHjl0g1pQ3tPccZYHRj_FFS_5jpO" >
</center>
<hr style="box-sizing: inherit; width: 600px; border-width: 5px; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-color: rgb(255, 0, 0);" /></div>
<p style="text-align: center;"><br style="box-sizing: inherit;" />
<br style="box-sizing: inherit;" />
<br style="box-sizing: inherit;" />
You can be asked to be removed by going <a href="http://www.noflem.date/jfoqqvn/Opj5_SFF_jRHYZccPt3Qp1g0ljHZloZNOyXDjb0JTw8XHhojerqEmyefNIioyBHQKsYQNOrq2wI5EtqOulbttbhi_irrfSUPvFP21McyI0PcCw4ItD5UtfSkITxQp6MW.ofeReaGt1-VCYIC44BM2xP6EAjTUR03vqsqWuMCFiMu">here </a>or write to us below</p>
<center style="box-sizing: inherit;">
<style type="text/css"><!--td {border: 1px solid #ccc;}br {mso-data-placement:same-cell;}-->
</style>
<span 28="" 361="" 7648="" 8619="" 872="" alton="" arnold="" ave.="" boynton="" chapel="" colonial="" ct="" data-sheets-userformat="{" data-sheets-value="{" fl="" ga="" oh="" pa="" road="" s.="" schoolhouse="" south="" st.="" style="font-size: 11pt; font-family: Calibri, Arial;" textspin:265="" va="" w.="" wall="">265 S. Schoolhouse St. Boynton Beach, FL 33435</span><span style="color: rgb(255, 255, 255); font-size: 4px;">ing</span></center>
</td>
</tr>
</tbody>
</table>
</center>
</body>
</html>
--------------008794531541259352341780--
`;
// Reset `lastIndex` if this regex is defined globally
// regex.lastIndex = 0;
let m;
if ((m = regex.exec(str)) !== null) {
// The result can be accessed through the `m`-variable.
m.forEach((match, groupIndex) => {
console.log(`Found match, group ${groupIndex}: ${match}`);
});
}
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 JavaScript, please visit: https://developer.mozilla.org/en/docs/Web/JavaScript/Guide/Regular_Expressions