RE: RegExp for preg_split()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxx] 
Sent: Friday, April 28, 2006 6:46 PM
To: Weber Sites LTD; php-general@xxxxxxxxxxxxx
Subject: Re:  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

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux