I have a file with configuration settings in it:
date : APString
{
dateformat = %m/%d/%y;
value = Date->currentDate;
}
firstName : APString
{
value = User->firstName;
}
lastName : APString
{
value = User->lastName;
}
I'm trying to read this into a useable array:
Array
(
[0] => firstName : APString
{
value = User->firstName;
}
[1] => firstName
[2] => APString
[3] => value = User->firstName;
)
I'm using this expression to get this:
preg_match_all("/(\\w+)\\s:\\s(\\w+)\n\\{\n(.*)\n\\}/", $s, $matches, PREG_SET_ORDER);
Now here's my problem. I have no problem getting the firstName and the lastName sections but if there is more than one line inside the brackets (the date section), it doesn't match at all. I see that there is a multiline modifier but I have no idea how to implement it into this. I would really appreciate any help. Thanks.