--W/nzBZO5zC0uMSeA
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On 2007-05-07 16:39:12 +0900 (Mon, May), Nanyang Zhan wrote:
> Don't get me wrong, because I just want to know how to separate English
> words from a string with ruby.
> There are strings (UTF-8 encoded) to record people's name,
> like:
> 
>  · > 帯· Bruce Willis
> Lee xiao ming
> these strings containing Chinese name(without space between characters),
> separated by a space, following an English name
> 
> or
> Frank Darabont
> Just an English name.
> 
> Would you give me an idea how to separate these Chinese characters(if
> any)?

Maybe a regexp similiar to
/^([^qazwsxedcrfvtgbyhnujmikolpQAZWSXEDCRFVTGBYHNUJMIKOLP ]+)/
would help?

Does [a-zA-Z] include Chinese characters? In Polish locale it includes
Polish non-ASCII characters, so I guess it might include Chinese ones.

I guess you want split a given string into words (separated by space),
and then check whether the first word starts or includes at least one
Chinese character.

-- 
No virus found in this outgoing message.
Checked by 'grep -i virus $MESSAGE'
Trust me.

--W/nzBZO5zC0uMSeA
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6-ecc01.6 (GNU/Linux)

iD8DBQFGPvmRsnU0scoWZKARAnaLAJsGCJwgW5wc0JgwJwwQLtAHY0eMjwCfbdb9
Ky1++DV5VAmjTHKyzASqYTI
ZW
-----END PGP SIGNATURE-----

--W/nzBZO5zC0uMSeA--