René's URL Explorer Experiment


Title: gh-86519: Add prefixmatch APIs to the re module by gpshead · Pull Request #31137 · python/cpython · GitHub

Open Graph Title: gh-86519: Add prefixmatch APIs to the re module by gpshead · Pull Request #31137 · python/cpython

X Title: gh-86519: Add prefixmatch APIs to the re module by gpshead · Pull Request #31137 · python/cpython

Description: Adds prefixmatch APIs to the re module as an alternate name for our long existing match APIs to help alleviate a common Python confusion for those coming from other languages regular expression libraries. These alleviate common confusion around what "match" means as Python is different than other popular languages regex libraries in our use of the term as an API name. The original match names are NOT being deprecated. Source tooling like linters, IDEs, and LLMs could suggest using prefixmatch instead of match to improve code health and reduce cognitive burden of understanding the intent of code when configured for a modern minimum Python version. See the documentation changes for a better description. Discussions took place in the PR, in the issue, and finally at https://discuss.python.org/t/add-re-prefixmatch-deprecate-re-match/105927 Issue: gh-86519 Documentation Preview: https://cpython-previews--31137.org.readthedocs.build/en/31137/

Open Graph Description: Adds prefixmatch APIs to the re module as an alternate name for our long existing match APIs to help alleviate a common Python confusion for those coming from other languages regular expression lib...

X Description: Adds prefixmatch APIs to the re module as an alternate name for our long existing match APIs to help alleviate a common Python confusion for those coming from other languages regular expression lib...

Opengraph URL: https://github.com/python/cpython/pull/31137

X: @github

direct link

Domain: github.com

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:94c002db-05a1-3288-00b5-b44c00d6a7c2
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-id9C78:2C4BED:4021FF9:5163390:6B021BDB
html-safe-noncebde73e2aef612a062208311872a0ab11048c7fcd1ee1cde77923572dbc1a50d8
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5Qzc4OjJDNEJFRDo0MDIxRkY5OjUxNjMzOTA6NkIwMjFCREIiLCJ2aXNpdG9yX2lkIjoiNDYyNzc0NTY3NTAxNDM3OTE1IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmacadfe0703e6aa9655b60b2df9568b64f7fc930a958a59df6fb6bb6c5ae3adb181
hovercard-subject-tagpull_request:840746777
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///pull_requests/show/files
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/python/cpython/pull/31137/files
twitter:imagehttps://avatars.githubusercontent.com/u/68491?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/68491?s=400&v=4
og:image:altAdds prefixmatch APIs to the re module as an alternate name for our long existing match APIs to help alleviate a common Python confusion for those coming from other languages regular expression lib...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None87e774ee7c6b3bee0490394e4d3e57ec9dbc956f74b87ea685dc8996c1676456
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/python/cpython git https://github.com/python/cpython.git
octolytics-dimension-user_id1525981
octolytics-dimension-user_loginpython
octolytics-dimension-repository_id81598961
octolytics-dimension-repository_nwopython/cpython
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id81598961
octolytics-dimension-repository_network_root_nwopython/cpython
turbo-body-classeslogged-out env-production page-responsive full-width
disable-turbotrue
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release423dbb54c5e7bfecc838eb387c1435eb3d0e760d
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/python/cpython/pull/31137/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fpull%2F31137%2Ffiles
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fpull%2F31137%2Ffiles
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=python%2Fcpython
Reloadhttps://github.com/python/cpython/pull/31137/files
Reloadhttps://github.com/python/cpython/pull/31137/files
Reloadhttps://github.com/python/cpython/pull/31137/files
pythonhttps://github.com/python
cpythonhttps://github.com/python/cpython
Codehttps://github.com/python/cpython
Issues5k+ (5k+)https://github.com/python/cpython/issues
Pull requests2.4k (2.4k)https://github.com/python/cpython/pulls
Actionshttps://github.com/python/cpython/actions
Projectshttps://github.com/python/cpython/projects
Security and qualityhttps://github.com/python/cpython/security
Insightshttps://github.com/python/cpython/insights
Sign up for GitHub https://github.com/signup?return_to=%2Fpython%2Fcpython%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2Fpython%2Fcpython%2Fissues%2Fnew%2Fchoose
gpsheadhttps://github.com/gpshead
python:mainhttps://github.com/python/cpython/tree/main
gpshead:prefixmatch-b42353https://github.com/gpshead/cpython/tree/prefixmatch-b42353
Conversation 30 https://github.com/python/cpython/pull/31137
Commits 19 https://github.com/python/cpython/pull/31137/commits
Checks 48 https://github.com/python/cpython/pull/31137/checks
Files changed https://github.com/python/cpython/pull/31137/files
Please reload this pagehttps://github.com/python/cpython/pull/31137/files
gh-86519: Add prefixmatch APIs to the re module https://github.com/python/cpython/pull/31137/files#top
Show all changes 19 commits https://github.com/python/cpython/pull/31137/files
587dc4d bpo-42353: Add prefixmatch APIs to the re module. gpshead Feb 5, 2022 https://github.com/python/cpython/pull/31137/commits/587dc4d74eae7f71381fd70a34663ca9ef65b8a9
c7d1581 Merge branch 'main' into prefixmatch-b42353 gpshead Jan 30, 2023 https://github.com/python/cpython/pull/31137/commits/c7d1581508c8379f6014f865df9236cb74c7e192
fa2885e fix editor fat finger typo during the merge. #vim gpshead Jan 30, 2023 https://github.com/python/cpython/pull/31137/commits/fa2885eccd72a3e6ec33721b459ad13358b9034a
6195ad7 3.12 gpshead Jan 30, 2023 https://github.com/python/cpython/pull/31137/commits/6195ad74fc9b48764c9f77209663f2d658773ad6
0296f29 Merge branch 'main' into prefixmatch-b42353 hauntsaninja Feb 26, 2023 https://github.com/python/cpython/pull/31137/commits/0296f29188aefa81b13c76b71d5a059dfae63d6f
bab8e8b Merge main and modernize the relevant docs. gpshead Apr 18, 2025 https://github.com/python/cpython/pull/31137/commits/bab8e8b06ba9f066047291f022e23e8180dc833e
149f6e4 Simplify, don't have duplicate definitions. gpshead Apr 19, 2025 https://github.com/python/cpython/pull/31137/commits/149f6e4751f20c9a5acd12da3e4b21138d6c7faf
e176692 Merge main into prefixmatch-b42353 gpshead Jan 31, 2026 https://github.com/python/cpython/pull/31137/commits/e1766928776b7bfe0d3efb283d156d5c9af86e41
58d8f57 Update match name removal language to be definitive gpshead Jan 31, 2026 https://github.com/python/cpython/pull/31137/commits/58d8f579c97918f142bfa4b0bd6fbd4c336c41b8
3cd9d71 Fix re.rst examples after match to search conversion gpshead Jan 31, 2026 https://github.com/python/cpython/pull/31137/commits/3cd9d7170b02515aad5906d7566ef2c4bf5a0d0e
d6090bb Replace name-parsing examples with Monty Python references gpshead Feb 1, 2026 https://github.com/python/cpython/pull/31137/commits/d6090bb003f1f5f5144c5c541eaf97355f59537f
341972f Address reviewer docs feedback: prefer prefixmatch throughout gpshead Feb 9, 2026 https://github.com/python/cpython/pull/31137/commits/341972fb81371c41ba5be563a97034553b19c762
cd8d85d Statically alias match to prefixmatch instead of runtime memcpy gpshead Feb 9, 2026 https://github.com/python/cpython/pull/31137/commits/cd8d85db96cb0f55eb03dab94b6182d19a6e72b6
74d51b3 Merge main into prefixmatch-b42353 gpshead Feb 9, 2026 https://github.com/python/cpython/pull/31137/commits/74d51b39e42752b2f3e755e1f514162041066362
4abdff0 Fix whatsnew 3.15 RST heading that matches git conflict marker gpshead Feb 9, 2026 https://github.com/python/cpython/pull/31137/commits/4abdff062ffdada0ea3f8275d09525edfb0bf480
6bacfb0 docs, remove errant "if ever" gpshead Feb 9, 2026 https://github.com/python/cpython/pull/31137/commits/6bacfb04792d01734a4b1676e5326c7ffece08ae
40e6a2a doc wording tweaks jf clarity gpshead Feb 9, 2026 https://github.com/python/cpython/pull/31137/commits/40e6a2acef765057953c5472d20b2eac88c3209e
b3c6948 Extract do_test_match_getitem helper to preserve git blame gpshead Feb 9, 2026 https://github.com/python/cpython/pull/31137/commits/b3c694858de5d67b18aee9481085e4e5559a121b
b277981 tweak news to match docs gpshead Feb 9, 2026 https://github.com/python/cpython/pull/31137/commits/b27798110364c43457f633a9b100ceb58b448733
Clear filters https://github.com/python/cpython/pull/31137/files
Please reload this pagehttps://github.com/python/cpython/pull/31137/files
Please reload this pagehttps://github.com/python/cpython/pull/31137/files
re.rst https://github.com/python/cpython/pull/31137/files#diff-fca5ee281345c4577087eadc6d85e52a6391e794eef2b7f78356d047f3b78957
3.15.rst https://github.com/python/cpython/pull/31137/files#diff-bd7a9c5b54eeb2b40e6db5e48e8d79d309d8738e776a40918773c6840189edf9
__init__.py https://github.com/python/cpython/pull/31137/files#diff-57c2a59def025dd119080dba7f4aa64e9ddb1e36ca8b1e71eeea6b6dc3b6c0fe
test_inspect.py https://github.com/python/cpython/pull/31137/files#diff-92d8ecc68ed9e7ce3b31a764d5b0368db1514365c2a6433bbe3bad5c3210cea0
test_re.py https://github.com/python/cpython/pull/31137/files#diff-8e462ca5167ec7a83a5710c179ef56cbae19cd614303fbcf2ec33fd9db914e2a
2022-02-05-00-15-03.bpo-42353.0ebVGG.rst https://github.com/python/cpython/pull/31137/files#diff-14067b3af2cc17dc5475558146d6d64e4b9c4cb050126305e9c13f8f8f7b2020
sre.c.h https://github.com/python/cpython/pull/31137/files#diff-1927afe20afe5333232e139c75a4e1450a5a3d0356e5164cf685c38176ef9f02
sre.c https://github.com/python/cpython/pull/31137/files#diff-b715247383fe7eb29c4592bf02da337a5ed85dfcbb4862bf3f5d4f2537dce22d
Doc/library/re.rsthttps://github.com/python/cpython/pull/31137/files#diff-fca5ee281345c4577087eadc6d85e52a6391e794eef2b7f78356d047f3b78957
View file https://github.com/gpshead/cpython/blob/b27798110364c43457f633a9b100ceb58b448733/Doc/library/re.rst
Open in desktop https://desktop.github.com
Please reload this pagehttps://github.com/python/cpython/pull/31137/files
https://github.com/python/cpython/blob/main/.github/CODEOWNERS#L116
Doc/whatsnew/3.15.rsthttps://github.com/python/cpython/pull/31137/files#diff-bd7a9c5b54eeb2b40e6db5e48e8d79d309d8738e776a40918773c6840189edf9
View file https://github.com/gpshead/cpython/blob/b27798110364c43457f633a9b100ceb58b448733/Doc/whatsnew/3.15.rst
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/python/cpython/pull/31137/{{ revealButtonHref }}
https://github.com/python/cpython/pull/31137/files#diff-bd7a9c5b54eeb2b40e6db5e48e8d79d309d8738e776a40918773c6840189edf9
Please reload this pagehttps://github.com/python/cpython/pull/31137/files
https://github.com/python/cpython/pull/31137/files#diff-bd7a9c5b54eeb2b40e6db5e48e8d79d309d8738e776a40918773c6840189edf9
https://github.com/python/cpython/pull/31137/files#diff-bd7a9c5b54eeb2b40e6db5e48e8d79d309d8738e776a40918773c6840189edf9
https://github.com/python/cpython/pull/31137/files#diff-bd7a9c5b54eeb2b40e6db5e48e8d79d309d8738e776a40918773c6840189edf9
Lib/re/__init__.pyhttps://github.com/python/cpython/pull/31137/files#diff-57c2a59def025dd119080dba7f4aa64e9ddb1e36ca8b1e71eeea6b6dc3b6c0fe
View file https://github.com/gpshead/cpython/blob/b27798110364c43457f633a9b100ceb58b448733/Lib/re/__init__.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/python/cpython/pull/31137/{{ revealButtonHref }}
https://github.com/python/cpython/pull/31137/files#diff-57c2a59def025dd119080dba7f4aa64e9ddb1e36ca8b1e71eeea6b6dc3b6c0fe
https://github.com/python/cpython/pull/31137/files#diff-57c2a59def025dd119080dba7f4aa64e9ddb1e36ca8b1e71eeea6b6dc3b6c0fe
https://github.com/python/cpython/pull/31137/files#diff-57c2a59def025dd119080dba7f4aa64e9ddb1e36ca8b1e71eeea6b6dc3b6c0fe
https://github.com/python/cpython/pull/31137/files#diff-57c2a59def025dd119080dba7f4aa64e9ddb1e36ca8b1e71eeea6b6dc3b6c0fe
https://github.com/python/cpython/pull/31137/files#diff-57c2a59def025dd119080dba7f4aa64e9ddb1e36ca8b1e71eeea6b6dc3b6c0fe
https://github.com/python/cpython/pull/31137/files#diff-57c2a59def025dd119080dba7f4aa64e9ddb1e36ca8b1e71eeea6b6dc3b6c0fe
https://github.com/python/cpython/pull/31137/files#diff-57c2a59def025dd119080dba7f4aa64e9ddb1e36ca8b1e71eeea6b6dc3b6c0fe
https://github.com/python/cpython/pull/31137/files#diff-57c2a59def025dd119080dba7f4aa64e9ddb1e36ca8b1e71eeea6b6dc3b6c0fe
https://github.com/python/cpython/pull/31137/files#diff-57c2a59def025dd119080dba7f4aa64e9ddb1e36ca8b1e71eeea6b6dc3b6c0fe
https://github.com/python/cpython/pull/31137/files#diff-57c2a59def025dd119080dba7f4aa64e9ddb1e36ca8b1e71eeea6b6dc3b6c0fe
Lib/test/test_inspect/test_inspect.pyhttps://github.com/python/cpython/pull/31137/files#diff-92d8ecc68ed9e7ce3b31a764d5b0368db1514365c2a6433bbe3bad5c3210cea0
View file https://github.com/gpshead/cpython/blob/b27798110364c43457f633a9b100ceb58b448733/Lib/test/test_inspect/test_inspect.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/python/cpython/pull/31137/{{ revealButtonHref }}
https://github.com/python/cpython/pull/31137/files#diff-92d8ecc68ed9e7ce3b31a764d5b0368db1514365c2a6433bbe3bad5c3210cea0
https://github.com/python/cpython/pull/31137/files#diff-92d8ecc68ed9e7ce3b31a764d5b0368db1514365c2a6433bbe3bad5c3210cea0
Lib/test/test_re.pyhttps://github.com/python/cpython/pull/31137/files#diff-8e462ca5167ec7a83a5710c179ef56cbae19cd614303fbcf2ec33fd9db914e2a
View file https://github.com/gpshead/cpython/blob/b27798110364c43457f633a9b100ceb58b448733/Lib/test/test_re.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/python/cpython/pull/31137/{{ revealButtonHref }}
https://github.com/python/cpython/pull/31137/files#diff-8e462ca5167ec7a83a5710c179ef56cbae19cd614303fbcf2ec33fd9db914e2a
https://github.com/python/cpython/pull/31137/files#diff-8e462ca5167ec7a83a5710c179ef56cbae19cd614303fbcf2ec33fd9db914e2a
https://github.com/python/cpython/pull/31137/files#diff-8e462ca5167ec7a83a5710c179ef56cbae19cd614303fbcf2ec33fd9db914e2a
https://github.com/python/cpython/pull/31137/files#diff-8e462ca5167ec7a83a5710c179ef56cbae19cd614303fbcf2ec33fd9db914e2a
https://github.com/python/cpython/pull/31137/files#diff-8e462ca5167ec7a83a5710c179ef56cbae19cd614303fbcf2ec33fd9db914e2a
https://github.com/python/cpython/pull/31137/files#diff-8e462ca5167ec7a83a5710c179ef56cbae19cd614303fbcf2ec33fd9db914e2a
https://github.com/python/cpython/pull/31137/files#diff-8e462ca5167ec7a83a5710c179ef56cbae19cd614303fbcf2ec33fd9db914e2a
https://github.com/python/cpython/pull/31137/files#diff-8e462ca5167ec7a83a5710c179ef56cbae19cd614303fbcf2ec33fd9db914e2a
https://github.com/python/cpython/pull/31137/files#diff-8e462ca5167ec7a83a5710c179ef56cbae19cd614303fbcf2ec33fd9db914e2a
https://github.com/python/cpython/pull/31137/files#diff-8e462ca5167ec7a83a5710c179ef56cbae19cd614303fbcf2ec33fd9db914e2a
Misc/NEWS.d/next/Library/2022-02-05-00-15-03.bpo-42353.0ebVGG.rsthttps://github.com/python/cpython/pull/31137/files#diff-14067b3af2cc17dc5475558146d6d64e4b9c4cb050126305e9c13f8f8f7b2020
View file https://github.com/gpshead/cpython/blob/b27798110364c43457f633a9b100ceb58b448733/Misc/NEWS.d/next/Library/2022-02-05-00-15-03.bpo-42353.0ebVGG.rst
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/python/cpython/pull/31137/{{ revealButtonHref }}
Modules/_sre/clinic/sre.c.hhttps://github.com/python/cpython/pull/31137/files#diff-1927afe20afe5333232e139c75a4e1450a5a3d0356e5164cf685c38176ef9f02
View file https://github.com/gpshead/cpython/blob/b27798110364c43457f633a9b100ceb58b448733/Modules/_sre/clinic/sre.c.h
Open in desktop https://desktop.github.com
how customized files appear on GitHubhttps://docs.github.com/github/administering-a-repository/customizing-how-changed-files-appear-on-github
Please reload this pagehttps://github.com/python/cpython/pull/31137/files
Please reload this pagehttps://github.com/python/cpython/pull/31137/files
Please reload this pagehttps://github.com/python/cpython/pull/31137/files
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.