Re: Regex Parsing
| From: | [ rswfire ] | Date: | Sun, 05 Dec 2004 14:22:06 +0000 |
| Subject: | Re: Regex Parsing | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-203520@lists.php.net to get a copy of this message | ||
> preg_match_all('#\[LEVEL([0-9])\](.*)\[/LEVEL[0-9]]#Uim', $content,
$matches);
You make it look so easy, thanks! That takes care of step one, but how do I
make it so everything in $content where there is a level set, is replaced
with ###LEVEL?###
Does #Uim tell it to only get the first [/LEVEL1] rather than going to the
bottom and getting the second? I've always wondered how to tell it to get
the first, rather than the last...
Thanks in advance!