diff --git a/regex_3/_regex_unicode.c b/regex_3/_regex_unicode.c index 80bf721..d56e55b 100644 --- a/regex_3/_regex_unicode.c +++ b/regex_3/_regex_unicode.c @@ -2451,9 +2451,9 @@ RE_PropertyValue re_property_values[] = { {1226, 6, 36}, /* SEPARATOR */ {1455, 6, 36}, /* Z */ {1456, 6, 36}, /* Z& */ - { 317, 6, 37}, /* CASEDLETTER */ - { 820, 6, 37}, /* LC */ - { 224, 6, 38}, /* ASSIGNED */ + { 224, 6, 37}, /* ASSIGNED */ + { 317, 6, 38}, /* CASEDLETTER */ + { 820, 6, 38}, /* LC */ {1092, 7, 0}, /* OTHER */ {1439, 7, 0}, /* XX */ { 445, 7, 1}, /* CONTROL */ diff --git a/regex_3/regex.py b/regex_3/regex.py index 7412514..b79ff17 100644 --- a/regex_3/regex.py +++ b/regex_3/regex.py @@ -241,7 +241,7 @@ "VERSION1", "X", "VERBOSE", "W", "WORD", "error", "Regex", "__version__", "__doc__", "RegexFlag"] -__version__ = "2.5.115" +__version__ = "2.5.116" # -------------------------------------------------------------------- # Public interface. diff --git a/regex_3/test_regex.py b/regex_3/test_regex.py index 36b85bb..34e4cf1 100644 --- a/regex_3/test_regex.py +++ b/regex_3/test_regex.py @@ -4313,6 +4313,10 @@ def test_hg_bugs(self): self.assertEqual(regex.match(r'(?a:\w)\w', 'd\N{CYRILLIC SMALL LETTER ZHE}').span(), (0, 2)) self.assertEqual(regex.match(r'(?a:\w)(?u:\w)', 'd\N{CYRILLIC SMALL LETTER ZHE}').span(), (0, 2)) + # Git issue 473: Emoji classified as letter + self.assertEqual(regex.match(r'^\p{LC}+$', '\N{SMILING CAT FACE WITH OPEN MOUTH}'), None) + self.assertEqual(regex.match(r'^\p{So}+$', '\N{SMILING CAT FACE WITH OPEN MOUTH}').span(), (0, 1)) + def test_fuzzy_ext(self): self.assertEqual(bool(regex.fullmatch(r'(?r)(?:a){e<=1:[a-z]}', 'e')), True) diff --git a/setup.py b/setup.py index 8bdc375..14706f5 100644 --- a/setup.py +++ b/setup.py @@ -7,7 +7,7 @@ setup( name='regex', - version='2022.6.2', + version='2022.7.9', description='Alternative regular expression module, to replace re.', long_description=long_description, long_description_content_type='text/x-rst', diff --git a/tools/build_regex_unicode.py b/tools/build_regex_unicode.py index b8da0b6..002e4f3 100644 --- a/tools/build_regex_unicode.py +++ b/tools/build_regex_unicode.py @@ -1398,7 +1398,7 @@ def make_key(value): val_list = list(unique(property['values'].values(), key=id)) for value in sorted(val_list, key=lambda val: val['id']): - valueset.append(tuple(value['names'])) + valueset.append((value['id'], tuple(value['names']))) valueset_id = valueset_dict.setdefault(tuple(valueset), len(valueset_dict)) @@ -1477,10 +1477,10 @@ def make_key(names): for valset, valset_id in sorted(valueset_dict.items(), key=lambda pair: pair[1]): - if valset_id == gc_valset_id: - valset = sorted(valset, key=make_key) + for val_id, names in valset: + if valset_id == gc_valset_id: + names = sorted(names, key=make_key) - for val_id, names in enumerate(valset): for name in names: c_file.write(''' {{{:4}, {:2}, {:3}}}, /* {} */\n'''.format(strings_dict[munge(name)], valset_id, val_id, munge(name)))