negated unicode properties in case-insensitive mode

Issue #22 resolved
Anonymous created an issue

While trying to test some of the recently listed properties supported by regex, it appears to me, that the negated properties don't work in case insensitive search; cf.:

>>> regex.findall(ur"(?i)\P{InBasicLatin}",u"aáb") [u'a', u'b'] >>> regex.findall(ur"(?i)\p{InBasicLatin}",u"aáb") [u'a', u'b'] >>> >>> regex.findall(ur"\P{InBasicLatin}",u"aáb") [u'\xe1'] >>> regex.findall(ur"\p{InBasicLatin}",u"aáb") [u'a', u'b'] >>>

as if the negated property literal \P would somehow taken in lowercase (?)

some other literals don't seem to be affected, e.g.

>>> regex.findall(ur"\s",u"a b\tcd") [u' ', u'\t'] >>> regex.findall(ur"\S",u"a b\tcd") [u'a', u'b', u'c', u'd'] >>> >>> regex.findall(ur"(?i)\s",u"a b\tcd") [u' ', u'\t'] >>> regex.findall(ur"(?i)\S",u"a b\tcd") [u'a', u'b', u'c', u'd'] >>>

works as expected.

Regards, vbr

Comments (1)

  1. Log in to comment