Regex extract data from String

I have following string structure

abcd("Some value",
  "Some data", Value);

asd("xyz", "abc");


I want to extract this as below

array[0]="abcd("Some value",
  "Some data", Value);"

array[1]=asd("xyz", "abc");


In above sample code spaces between the functions is not fix & newline inside the function is also not fix.

I tried using the following regex but it is not working

preg_match_all("/.*((.+?));/is", $input_lines, $output_array);

Source: regex

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.