Title: Soft deprecate `re.match` and `re.Pattern.match` in favour of `prefixmatch` · Issue #148100 · python/cpython · GitHub
Open Graph Title: Soft deprecate `re.match` and `re.Pattern.match` in favour of `prefixmatch` · Issue #148100 · python/cpython
X Title: Soft deprecate `re.match` and `re.Pattern.match` in favour of `prefixmatch` · Issue #148100 · python/cpython
Description: Feature or enhancement Proposal: In #86519 (PR #31137), we added new re.prefixmatch and re.Pattern.prefixmatch as explicit names for re.match and re.Pattern.match, because it's really not obvious the shorter old names include a prefix an...
Open Graph Description: Feature or enhancement Proposal: In #86519 (PR #31137), we added new re.prefixmatch and re.Pattern.prefixmatch as explicit names for re.match and re.Pattern.match, because it's really not obvious t...
X Description: Feature or enhancement Proposal: In #86519 (PR #31137), we added new re.prefixmatch and re.Pattern.prefixmatch as explicit names for re.match and re.Pattern.match, because it's really not obvio...
Opengraph URL: https://github.com/python/cpython/issues/148100
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Soft deprecate `re.match` and `re.Pattern.match` in favour of `prefixmatch`","articleBody":"# Feature or enhancement\n\n### Proposal:\n\nIn https://github.com/python/cpython/issues/86519 (PR https://github.com/python/cpython/pull/31137), we added new `re.prefixmatch` and `re.Pattern.prefixmatch` as explicit names for `re.match` and `re.Pattern.match`, because it's really not obvious the shorter old names include a prefix anchor; you probably meant to use `search` (no anchors) or `fullmatch` (prefix and suffix anchors).\n\nThis is essentially a [soft deprecation](https://docs.python.org/3/glossary.html#term-soft-deprecated) of the `match` names:\n\n* It's okay to use the old name in old code, but prefer the new name in new code.\n* We don't plan on removing the old name or emitting deprecation warnings.\n\nLet's make this explicit.\n\n\n### Has this already been discussed elsewhere?\n\nNo response given\n\n### Links to previous discussion of this feature:\n\n_No response_\n\n\u003c!-- gh-linked-prs -->\n### Linked PRs\n* gh-148101\n\u003c!-- /gh-linked-prs -->\n","author":{"url":"https://github.com/hugovk","@type":"Person","name":"hugovk"},"datePublished":"2026-04-04T17:20:13Z","url":"https://github.com/python/cpython/issues/148100"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:f1a68403-736e-f1de-ff8e-e55296809692 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | D262:2E124E:39E6F25:49F9FCD:6B020952 |
| html-safe-nonce | 5148eec7fe41894a5fa73fec74946d1b72133f3208072fbdb72336d4965e038b |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEMjYyOjJFMTI0RTozOUU2RjI1OjQ5RjlGQ0Q6NkIwMjA5NTIiLCJ2aXNpdG9yX2lkIjoiODc5ODgwODY2MjA4Mjg3MDU4IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 182e9f333d9316b68ce8c3293e31372066840617d94b4d8ff966ea0f3796b50f |
| hovercard-subject-tag | issue:4205398868 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/python/cpython/148100/issue_layout |
| twitter:image | https://opengraph.githubassets.com/206d002c6494ecec907ae4fe225a412f088f74966c822a56cbd43a3f6ba5f1be/python/cpython/issues/148100 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/206d002c6494ecec907ae4fe225a412f088f74966c822a56cbd43a3f6ba5f1be/python/cpython/issues/148100 |
| og:image:alt | Feature or enhancement Proposal: In #86519 (PR #31137), we added new re.prefixmatch and re.Pattern.prefixmatch as explicit names for re.match and re.Pattern.match, because it's really not obvious t... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | hugovk |
| hostname | github.com |
| expected-hostname | github.com |
| None | 87e774ee7c6b3bee0490394e4d3e57ec9dbc956f74b87ea685dc8996c1676456 |
| turbo-cache-control | no-preview |
| go-import | github.com/python/cpython git https://github.com/python/cpython.git |
| octolytics-dimension-user_id | 1525981 |
| octolytics-dimension-user_login | python |
| octolytics-dimension-repository_id | 81598961 |
| octolytics-dimension-repository_nwo | python/cpython |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 81598961 |
| octolytics-dimension-repository_network_root_nwo | python/cpython |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 423dbb54c5e7bfecc838eb387c1435eb3d0e760d |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width