fork download
  1. <?php
  2.  
  3. $regex = '/(?<=Amount:)\d+/';
  4. $str = 'Date:21 Month:03 Year:2017 Amount:50 Category:Grocery Account:bank Note:expensive';
  5. preg_match_all($regex, $input, $matches);
  6. print_r($matches);
Success #stdin #stdout #stderr 0.01s 82944KB
stdin
 
Date:21
Month:03
Year:2017
Amount:50
Category:Wow
Account:The
Note:This
 
stdout
Array
(
    [0] => Array
        (
        )

)
stderr
PHP Notice:  Undefined variable: input in /home/4rNbQX/prog.php on line 5