<?php $re = '~/\*[^*]*\*+(?:[^/*][^*]*\*+)*/(*SKIP)(*F)|^\s*([^=\n]+?)\s*=\s*(.*?);\h*(?:$|\r?\n)~sm'; $str = "/*\nanything description\n*/\n\nData1 = value1;\n\nOtherData<> = Other Value;\n\n/*\nmy other description\n*/\n\nAny thing = Any \nAnswer;\n\n/*\n\nthis is description and must not detect\n\nDescription_Data = Any_Value;\n\n*/"; preg_match_all($re, $str, $matches);print_r($matches[1]);print_r($matches[2]);
Standard input is empty
Array ( [0] => Data1 [1] => OtherData<> [2] => Any thing ) Array ( [0] => value1 [1] => Other Value [2] => Any Answer )
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!