|
Posted by Alvaro G. Vicario on 12/17/94 11:56
*** MD escribió/wrote (Fri, 25 Aug 2006 21:25:41 GMT):
> 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.
preg_replace('/ .*$/', '', some string"); // Not tested
--
-+ http://alvaro.es - Álvaro G. Vicario - Burgos, Spain
++ Mi sitio sobre programación web: http://bits.demogracia.com
+- Mi web de humor con rayos UVA: http://www.demogracia.com
--
Navigation:
[Reply to this message]
|