Re: hello and a question
| From: | jimw at apache dot org | Date: | Tue, 21 Aug 2001 23:54:36 +0000 |
| Subject: | Re: hello and a question | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-63797@lists.php.net to get a copy of this message | ||
Kevin Keeler <insanity@uwns.underworld.net> wrote:
> $entry_hidden =
> eregi_replace("<hide>.+</hide>","<hidden>",$entry);
try: $entry_hidden =
preg_replace("|<hide>.+?</hide>|i","<hidden>",$entry);
".+" is 'greedy', meaning it consumes as much as text as it can. with
perl-like regular expressions, you can add a trailing "?" which makes
the + and * operators non-greedy.
jim