$re = '/(?<=Amount:\s?\$)([0-9,]+\.\d{2})|(?<=Date:\s?)(\d{2}/\d{2}/\d{4})|(?<=Invoice:\s?)(\d+)|(?<=Billing Account Name:\s?)([\w\s]+)/m';
$str = 'Dear Valued AdRoll Customer,
Your payment for invoice #5925702 has been processed. Please see below for additional details.
Learn more about your billing history.
-- Transaction Details --
Amount: $450.42
Date: 10/15/2024
Invoice: 5925702
Billing Account Name: RRL Exhbits
Profile(s):
Reagan Library
If you have any questions, please contact support@adroll.com.
Download Invoice PDF
Log in to AdRoll
---
If you have any questions, don’t hesitate to contact our Support team or chat with us live.';
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