Re: Parse search string a la Google (Regular expression?)
| From: | Sebastian Bergmann | Date: | Wed, 27 Nov 2002 21:39:47 +0000 |
| Subject: | Re: Parse search string a la Google (Regular expression?) | ||
| References: | 1 | Groups: | php.dev php.general |
| Request: | Send a blank email to php-dev+get-91848@lists.php.net to get a copy of this message | ||
Benny Rasmussen wrote:
> Hi,
>
> In my application I would like to offer a search interface like Google
> and other popular search engines. The complication for me is to explode
> the search string into proper array elements, like this:
>
> $search_str = "\"search for this sentence\" -NotForThisWord
> ButDefinitelyForThisWord";
>
> $array[0]: "search for this sentence"
> $array[1]: "-NotForThisWord"
> $array[2]: "ButDefinitelyForThisWord"
>
> I have tried to use regular expressions but my case seems to be a bit
> more complicated for this (?).
>
> Does anybody have a code snippet, a class or something, that can help
> me with this?
>
> Thanks in advance,
> Joachim
>
> --
> PHP Development Mailing List <http://www.php.net/>
> To unsubscribe, visit: http://www.php.net/unsub.php
Forwarding to php-general@lists.php.net, since this would be the
appropriate list for the topic.
php-dev@lists.php.net is for the development *of* PHP itself, not for
developing *with* PHP.
--
Sebastian Bergmann
http://sebastian-bergmann.de/ http://phpOpenTracker.de/
Did I help you? Consider a gift: http://wishlist.sebastian-bergmann.de/