fork download
  1. <?php
  2.  
  3. $string = "field1,field2,(if(isnull(table.id_),1,table.id_)) as field3,field4;";
  4.  
  5. "/^[^\(]+|[^\)]+$|([a-zA-Z]\w*+(?:[.][a-zA-Z]\w*+)?)(?!\s*['\"(])/"
  6. ,$string
  7. ,$matches
  8. );
  9.  
  10. $i = 0;
  11. foreach ($matches[1] as $match) {
  12. if (!empty($match)) {
  13. print($matches[0][$i]) . "\n";
  14. }
  15. $i++;
  16. }
  17.  
Success #stdin #stdout 0.01s 23856KB
stdin
Standard input is empty
stdout
table.id_
table.id_