preg_match_all question
| From: | Phil Ewington - iModel Ltd. | Date: | Fri, 16 Jan 2009 09:42:41 +0000 |
| Subject: | preg_match_all question | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-286491@lists.php.net to get a copy of this message | ||
Hi All,
Having an issue with regular expressions, never been my strong point!
The following pattern only picks up one instance per line, if more than one instance exists all text from first {{ to last }} is included, can anyone point out where I am going wrong?
preg_match_all("/\{\{lang:(.*)\}\}/", $str, $tags);
Here is an example of what needs to be processed
<ul><li><span>{{lang:PA1Feature1}}</span></li><li><span>{{lang:PA1Feature2}}</span></li></ul>
<ul><li><span>{{lang:PA2Feature1}}</span></li><li><span>{{lang:PA2Feature2}}</span></li></ul>
TIA
Phil.