snip...
> > Like:
> > if unicode string:
> > print 'string's line #'
> > else:
> > process the string
>
If I use "re.UNICODE" like: m = re.match(r"\w+", s, re.UNICODE)
then it seems to fix my problem. Trying to read as much as I can on
unicode
--
http://mail.python.org/ma
* goldtech (Wed, 24 Oct 2007 12:09:24 -0700)
> I have a regular expression test in a script. When a unicode character
> get tested in the regex it gives an error:
As Martin pointed out: you are *not* using unicode...
> Question: Is there a way to test a string for unicode chars (ie. test
> if a
> I have a regular expression test in a script. When a unicode character
> get tested in the regex it gives an error:
>
> UnicodeError: ASCII decoding error: ordinal not in range(128)
>
> Question: Is there a way to test a string for unicode chars (ie. test
> if a string will throw the error cite
goldtech wrote:
> I have a regular expression test in a script. When a unicode character
> get tested in the regex it gives an error:
>
> UnicodeError: ASCII decoding error: ordinal not in range(128)
>
> Question: Is there a way to test a string for unicode chars (ie. test
> if a string will thro
2007/10/24, goldtech <[EMAIL PROTECTED]>:
> Question: Is there a way to test a string for unicode chars (ie. test
> if a string will throw the error cited above).
yes there ist :)
>>> isinstance(u"a", basestring)
True
>>> isinstance(u"a", unicode)
True
>>> isinstance("a", unicode)
False
>>> isins
Hi,
I have a regular expression test in a script. When a unicode character
get tested in the regex it gives an error:
UnicodeError: ASCII decoding error: ordinal not in range(128)
Question: Is there a way to test a string for unicode chars (ie. test
if a string will throw the error cited above).