Skip to content

Commit a4a6d94

Browse files
author
Matthew Barnett
committed
Git issue 580: Regression in v2025.7.31: \P{L} no longer matches in simple patterns
1 parent becb0d4 commit a4a6d94

File tree

5 files changed

+14
-5
lines changed

5 files changed

+14
-5
lines changed

changelog.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
Version: 2025.7.32
2+
3+
Git issue 580: Regression in v2025.7.31: \P{L} no longer matches in simple patterns
4+
15
Version: 2025.7.31
26

37
Further updates to main.yml.

pyproject.toml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
11
[build-system]
2-
requires = ["setuptools > 61.0"]
2+
requires = ["setuptools > 77.0.3"]
33
build-backend = "setuptools.build_meta"
44

55
[project]
66
name = "regex"
7-
version = "2025.7.31"
7+
version = "2025.7.32"
88
description = "Alternative regular expression module, to replace re."
99
readme = "README.rst"
1010
authors = [
1111
{name = "Matthew Barnett", email = "[email protected]"},
1212
]
13-
license = {file = "LICENSE.txt"}
13+
license = "Apache-2.0 AND CNRI-Python"
14+
license-files = ["LICENSE.txt"]
1415

1516
classifiers = [
1617
"Development Status :: 5 - Production/Stable",

regex_3/_regex_core.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,7 @@ def _compile_firstset(info, fs):
336336
"Compiles the firstset for the pattern."
337337
reverse = bool(info.flags & REVERSE)
338338
fs = _check_firstset(info, reverse, fs)
339-
if not fs:
339+
if not fs or isinstance(fs, AnyAll):
340340
return []
341341

342342
# Compile the firstset.

regex_3/regex.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@
241241
"VERSION1", "X", "VERBOSE", "W", "WORD", "error", "Regex", "__version__",
242242
"__doc__", "RegexFlag"]
243243

244-
__version__ = "2.5.156"
244+
__version__ = "2.5.157"
245245

246246
# --------------------------------------------------------------------
247247
# Public interface.

regex_3/test_regex.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4373,6 +4373,10 @@ def test_hg_bugs(self):
43734373
self.assertEqual(bool(regex.match(r'\d', '\uFF19')), True)
43744374
self.assertEqual(bool(regex.match(r'(?a:\d)', '\uFF19')), False)
43754375

4376+
# Git issue 580: Regression in v2025.7.31: \P{L} no longer matches in simple patterns
4377+
self.assertEqual(bool(regex.match(r"\A\P{L}?\p{L}", "hello,")), True)
4378+
self.assertEqual(bool(regex.fullmatch(r"\A\P{L}*(?P<w>\p{L}+)\P{L}*\Z", "hello,")), True)
4379+
43764380
def test_fuzzy_ext(self):
43774381
self.assertEqual(bool(regex.fullmatch(r'(?r)(?:a){e<=1:[a-z]}', 'e')),
43784382
True)

0 commit comments

Comments
 (0)