Re: REGEX Question
| From: | SLanger at spirit21 dot de | Date: | Wed, 18 Jun 2003 08:39:50 +0000 |
| Subject: | Re: REGEX Question | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-151937@lists.php.net to get a copy of this message | ||
Hello
Two things:
First wouldn't it be faster to use strpos and substr if you simply have to
find the literate <!-- start_tag --> and <!-- end_tag -->.
Second: If you use your regex and you have something like
"<!-- start_tag --> This is some text to grasp<!-- end_tag --> this is
text I don't want <!-- start_tag --> This is some other text I want<!--
end_tag -->"
The result would be " This is some text to grasp<!-- end_tag --> this is
text I don't want <!-- start_tag --> This is some other text I want".
You should use the " *+" quantifier in order to only grab the content "
This is some text to grasp".
Regards
Stefan Langer