RE: [PHP] RegExp for preg_split()
| From: | Weber Sites LTD | Date: | Fri, 28 Apr 2006 18:18:29 +0000 |
| Subject: | RE: [PHP] RegExp for preg_split() | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-235025@lists.php.net to get a copy of this message | ||
This is part of what I need.
You found all of the phrases (e.g. all of the strings inside " ")
But I also need all of the words that are not inside " ".
thanks
-----Original Message-----
From: tedd [mailto:tedd@sperling.com]
Sent: Friday, April 28, 2006 6:46 PM
To: Weber Sites LTD; php-general@lists.php.net
Subject: Re: [PHP] RegExp for preg_split()
At 6:16 PM +0200 4/28/06, Weber Sites LTD wrote:
>Hi
>
>I'm looking for the RegExp that will split a search string into search
>keywords.
>while taking " " into account.
>
>From what I managed to find I can get all of the words into an array
>but I would like all of the words inside " " to be in the same array
>cell.
>
>NE1?
>
>thanks
>
>berber
berber:
Not knowing exactly what you want, this will sort out the "phrase strings".
$string = 'Medaillons, Listels, "custom stuff", "more things", entryway,
accents, showplace'; echo("$string <br/>"); preg_match_all
('/".*?"/',
$string, $matchs); foreach($matchs[0] as $matchs)
{
echo("$matchs <br/>");
}
HTH's
tedd
--
----------------------------------------------------------------------------
----
http://sperling.com