Re: RegExp for preg_split()

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

 



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