jewishj
06-01-2007, 09:17 AM
I need some help with a regex. I need it to pull the data from a specific content in a language file which details info about the language file.
The comment looks like this:
/************************************************
LANGUAGE FILE
SITE: MySite
LANGUAGE: English
FILE: en.php
************************************************/
I need to get the information so that I can easily figure out that SITE = MySite, LANGAUGE = English, and so on. So I would either need an array like this:
array(
array('SITE','MySite'),
array('LANGAUGE','English),
etc.
);
or something like this:
array('SITE: MySite', 'LANGUAGE: English', etc.);
Right now I have a regex which does not work at all - it returns just an empty array when used in conjunction with preg_match_all(). The regex I have come up with so far is:
$pattern="/^(\/[\*]*)(^LANGUAGE\sFILE)(^.*)*(^[\*]*\/*)/smU";
Thanks in advance for any help in fixing this regex or in pointing me in the right direction.
The comment looks like this:
/************************************************
LANGUAGE FILE
SITE: MySite
LANGUAGE: English
FILE: en.php
************************************************/
I need to get the information so that I can easily figure out that SITE = MySite, LANGAUGE = English, and so on. So I would either need an array like this:
array(
array('SITE','MySite'),
array('LANGAUGE','English),
etc.
);
or something like this:
array('SITE: MySite', 'LANGUAGE: English', etc.);
Right now I have a regex which does not work at all - it returns just an empty array when used in conjunction with preg_match_all(). The regex I have come up with so far is:
$pattern="/^(\/[\*]*)(^LANGUAGE\sFILE)(^.*)*(^[\*]*\/*)/smU";
Thanks in advance for any help in fixing this regex or in pointing me in the right direction.