fork(1) download
  1. <?php
  2.  
  3. $str = ".lng('fgt'); .lng(\"sdfc\"); .lng(\"sdFgfc');";
  4.  
  5.  
  6.  
  7.  
  8.  
  9. //This regex will do
  10.  
  11. preg_match_all('#\.lng\(([\'"])(.*?)(?:\1)\)#', $str, $matches);
  12. print_r($matches);
  13. ?>
Success #stdin #stdout 0.02s 13112KB
stdin
Standard input is empty
stdout
Array
(
    [0] => Array
        (
            [0] => .lng('fgt')
            [1] => .lng("sdfc")
        )

    [1] => Array
        (
            [0] => '
            [1] => "
        )

    [2] => Array
        (
            [0] => fgt
            [1] => sdfc
        )

)