jamadden / mrab-regex-hg

Automatically exported from code.google.com/p/mrab-regex-hg
0 stars 2 forks source link

regex.search("[[:ascii:]]", "\N{KELVIN SIGN}", flags=regex.I|regex.V1) doesn't return None #63

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
>>> import regex
>>> regex.search("[[:ascii:]]", "\N{KELVIN SIGN}", flags=regex.I|regex.V1)
<_regex.Match object at 0x00C0BCD0>
>>>

What is the expected output? What do you see instead?
The expected output is the following:
>>> import regex
>>> regex.search("[[:ascii:]]", "\N{KELVIN SIGN}", flags=regex.I|regex.V1)
None
>>>

What version of the product are you using? On what operating system?
Windows XP Home SP3 (32-bit version)
Python 3.2.2 (default, Sep  4 2011, 09:51:08) [MSC v.1500 32 bit (Intel)] on win
32
regex 0.1.20120209

Please provide any additional information below.

Original issue reported on code.google.com by msm...@gmail.com on 22 Feb 2012 at 2:16

GoogleCodeExporter commented 9 years ago
Hi,
I think, there may some problem in caseless matching, it may or may not be a 
valid match using the full casefolding, but here it also matches in V0:

>>> regex.findall(ur"(?V1i)K", u"\N{KELVIN SIGN}")
[u'\u212a']
>>> regex.findall(ur"(?V1)K", u"\N{KELVIN SIGN}")
[]
>>> regex.findall(ur"(?V0i)K", u"\N{KELVIN SIGN}")
[u'\u212a']
>>> regex.findall(ur"(?V0)K", u"\N{KELVIN SIGN}")
[]
>>> 

I am not sure, whether there might be some other characters with such behaviour.

vbr

Original comment by Vlastimil.Brom@gmail.com on 23 Feb 2012 at 4:20

GoogleCodeExporter commented 9 years ago
Please see the following URL:
http://perl5.git.perl.org/perl.git/commitdiff/ea317ccb31f6a2617f030e911668f46874
f7dacb

Original comment by msm...@gmail.com on 23 Feb 2012 at 4:39

GoogleCodeExporter commented 9 years ago
Fixed in regex 0.1.20120301.

Original comment by re...@mrabarnett.plus.com on 1 Mar 2012 at 9:07

GoogleCodeExporter commented 9 years ago

Original comment by re...@mrabarnett.plus.com on 1 Mar 2012 at 9:07