Re: Re: hello and a question
| From: | Kevin Keeler | Date: | Wed, 22 Aug 2001 00:06:24 +0000 |
| Subject: | Re: Re: hello and a question | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-63798@lists.php.net to get a copy of this message | ||
yay.
this preg business methinks needs some more looking into. ;) everywhere
I've looked theres always one or 2 people proselytizing its greatness.
my late-night "boredom" reading of O'Reilly's _Perl_ (sans computer or
pause) left little behind little information in my head, not surprisingly.
Thanks much, sir.
--kevin
On 21 Aug 2001 jimw@apache.org wrote:
> 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
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> For additional commands, e-mail: php-general-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
>