$re = '/(ID)?(\s?)([0-9]\d{3,7}\s?(\(?)[m|M|g|G|a|A|l|L|I|\|])(\s?)/';
$str = 'Payment No. 48 Contract Date 23/03/2013 Amounting To 209.08 Euro On the 23/03/2017 pay for this sole Bill of Exchange to the order of Finance House The sum of Two Hundred Nine Eur and 8 euro cents Value of goods received which places to account as per advice To ADRIAN DEBATTISTA 7 Address 121 TRIQ IXXATT Gzira I/We accept and sign jointly and severally PRO ET NOE ';
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