$re = '/Item.+/m';
$str = 'Parker Tech
74 Lincoln Green Lane
Church Stoke, PA 19402
(123) 456-7890
Invoice
Submitted on 9/9/2016
Invoice for
Name
Company name
Email
Street address
City, State, Zip
Payable to
Bobby John
Bobby Co.
bobby@john.com
Project
Project name
Invoice #
12345
Due date
9/16/2016
Description Qty Unit price Total price
Item #1 1 $200.00 $200.00
Item #2 2 $200.00 $400.00
$0.00
$0.00
Notes: Subtotal $600.00
Adjustments -$100.00
$500.00';
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