mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
bpo-47081: Replace "qualifiers" with "quantifiers" in the re module documentation (GH-32028)
It is a more commonly used term.
This commit is contained in:
parent
4f97d64c83
commit
c6cd3cc93c
5 changed files with 21 additions and 21 deletions
|
@ -2038,9 +2038,9 @@ class ReTests(unittest.TestCase):
|
|||
with self.assertRaisesRegex(TypeError, "got 'type'"):
|
||||
re.search("x*", type)
|
||||
|
||||
def test_possessive_qualifiers(self):
|
||||
"""Test Possessive Qualifiers
|
||||
Test qualifiers of the form @+ for some repetition operator @,
|
||||
def test_possessive_quantifiers(self):
|
||||
"""Test Possessive Quantifiers
|
||||
Test quantifiers of the form @+ for some repetition operator @,
|
||||
e.g. x{3,5}+ meaning match from 3 to 5 greadily and proceed
|
||||
without creating a stack frame for rolling the stack back and
|
||||
trying 1 or more fewer matches."""
|
||||
|
@ -2077,7 +2077,7 @@ class ReTests(unittest.TestCase):
|
|||
self.assertIsNone(re.match("^x{}+$", "xxx"))
|
||||
self.assertTrue(re.match("^x{}+$", "x{}"))
|
||||
|
||||
def test_fullmatch_possessive_qualifiers(self):
|
||||
def test_fullmatch_possessive_quantifiers(self):
|
||||
self.assertTrue(re.fullmatch(r'a++', 'a'))
|
||||
self.assertTrue(re.fullmatch(r'a*+', 'a'))
|
||||
self.assertTrue(re.fullmatch(r'a?+', 'a'))
|
||||
|
@ -2096,7 +2096,7 @@ class ReTests(unittest.TestCase):
|
|||
self.assertIsNone(re.fullmatch(r'(?:ab)?+', 'abc'))
|
||||
self.assertIsNone(re.fullmatch(r'(?:ab){1,3}+', 'abc'))
|
||||
|
||||
def test_findall_possessive_qualifiers(self):
|
||||
def test_findall_possessive_quantifiers(self):
|
||||
self.assertEqual(re.findall(r'a++', 'aab'), ['aa'])
|
||||
self.assertEqual(re.findall(r'a*+', 'aab'), ['aa', '', ''])
|
||||
self.assertEqual(re.findall(r'a?+', 'aab'), ['a', 'a', '', ''])
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue