limodou wrote:
> On 10/27/06, Wijaya Edward <[EMAIL PROTECTED]> wrote:
>>
>> Thanks but my intention is to strictly use regex.
>> Since there are separator I need to include as delimiter
>> Especially for the case like this:
>>
>> >>> str = '\xc5\xeb\xc7\xd5\xbc--FOO--BAR'
>> >>> field = list(str)
>> >>> print field
>> ['\xc5', '\xeb', '\xc7', '\xd5', '\xbc', '-', '-', 'F', 'O', 'O', '-', 
>> '-', 'B', 'A', 'R']
>>
>> What we want as the output is this instead:
>> ['\xc5', '\xeb', '\xc7', '\xd5', '\xbc','FOO','BAR]
>>
>> What's the best way to do it?
>>
> If the case is very simple, why not just replace '_' with '', for example:
> 
> str.replace('-', '')
> 
Except he appears to want the Chinese characters as elements of the 
list, and English words as elements of the list.  Note carefully the 
last two elements in his desired list.  I'm still puzzling this one...
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to