regular expression space and 2 byte space

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
When receiving a particular string and if the string has a space/ 2 byte
space with some trailing string.
I want to remove the trailing string.

$somestring = "some string";
$match_pattern = "/(.*)\s.*/iu";

preg_match_all($match_pattern, $somestring, $match );
echo $match[1][0]

Looks like this only works for single byte space.

How can I define the regular expressoin so that it finds the 2 bytes space.

Thanks in advance.

Re: regular expression space and 2 byte space

*** MD escribió/wrote (Fri, 25 Aug 2006 21:25:41 GMT):
Quoted text here. Click to load it

preg_replace('/  .*$/', '', some string"); // Not tested

-+ - Álvaro G. Vicario - Burgos, Spain
++ Mi sitio sobre programación web:
+- Mi web de humor con rayos UVA:

Site Timeline