GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — gh-86519: Update docs for `prefixmatch` by hugovk · Pull Request #148096 · python/cpython

Conversation

@hugovk

@hugovk hugovk commented Apr 4, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

regex HOWTO:

Update match to prefixmatch.

And many of these examples don't specifically need to match a prefix, so let's prefer search for general cases, and introduce it first.

Other files:

Change to prefixmatch where prefixing is important and relevant, otherwise change to search.


📚 Documentation preview 📚: https://cpython-previews--148096.org.readthedocs.build/

  • Issue: Proposal: re.prefixmatch method (alias for re.match) #86519

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@hugovk
Update regex HOWTO for re.prefixmatch
f82c1fc
@bedevere-app bedevere-app Bot added awaiting core review docs Documentation in the Doc dir skip news labels Apr 4, 2026
@github-project-automation github-project-automation Bot added this to Docs PRs Apr 4, 2026
@github-project-automation github-project-automation Bot moved this to Todo in Docs PRs Apr 4, 2026
@hugovk hugovk changed the title Update regex HOWTO for prefixmatch gh-86519: Update regex HOWTO for prefixmatch Apr 4, 2026
@bedevere-app bedevere-app Bot mentioned this pull request Apr 4, 2026
Proposal: re.prefixmatch method (alias for re.match) #86519
Closed
@hugovk
hugovk marked this pull request as draft April 4, 2026 15:38
@bedevere-app bedevere-app Bot removed the awaiting core review label Apr 4, 2026
hugovk added 5 commits April 4, 2026 18:46
@hugovk
Update fnmatch to prefixmatch
3362193
@hugovk
Update glob to prefixmatch
8d0571f
@hugovk
Update typing to search
2fd6236
@hugovk
Update logging-cookbook to prefixmatch
ca8b571
@hugovk
Preserve HTML ID
1f263e9
@hugovk hugovk changed the title gh-86519: Update regex HOWTO for prefixmatch gh-86519: Update docs for prefixmatch Apr 4, 2026
@hugovk
hugovk marked this pull request as ready for review April 4, 2026 16:06
@hugovk
hugovk requested review from AlexWaygood, JelleZijlstra and vsajip as code owners April 4, 2026 16:06
@bedevere-app bedevere-app Bot added the awaiting core review label Apr 4, 2026
@hugovk hugovk mentioned this pull request Apr 4, 2026
gh-86519: Add prefixmatch APIs to the re module #31137
Merged
gpshead
gpshead reviewed Apr 4, 2026
View reviewed changes
Comment thread Doc/howto/regex.rst Outdated
(2, 7)

Sometimes you'll be tempted to keep using :func:`re.match`, and just add ``.*``
Sometimes you'll be tempted to keep using :func:`re.prefixmatch`, and just add ``.*``

@gpshead gpshead Apr 4, 2026

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this temptation true any longer?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@hugovk hugovk Apr 4, 2026

Copy link
Copy Markdown
Member Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hopefully the new name makes things clearer. I've removed this bit.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread Doc/howto/regex.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Doc/howto/regex.rst Outdated
| | location where this RE matches. |
+------------------+-----------------------------------------------+
| ``prefixmatch()``| Determine if the RE matches at the beginning |
| | of the string. |

@gpshead gpshead Apr 4, 2026

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd at least leave a little mention of "Previously named match()" with a link to the canonical doc section explaining the renaming and soft deprecation in here.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@hugovk hugovk Apr 4, 2026

Copy link
Copy Markdown
Member Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
hugovk and others added 4 commits April 4, 2026 22:07
@hugovk
Mention previous name
4090e69
@hugovk
Revise 'prefixmatch() versus search()'
ff22eb2
@hugovk
Trim a bit more from 'prefixmatch() versus search()'
920a695
@hugovk @hauntsaninja
Improve title
96d80f4
Co-authored-by: Shantanu <[email protected]>
hugovk
hugovk commented Apr 4, 2026
View reviewed changes
Comment thread Doc/howto/regex.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

@hugovk
Fix underline length to fix docs build
d2bdc8e
@AlexWaygood
AlexWaygood removed their request for review April 6, 2026 21:41
@hugovk

hugovk commented Apr 14, 2026

Copy link
Copy Markdown
Member Author

Any further review comments?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

JelleZijlstra
JelleZijlstra reviewed Apr 14, 2026
View reviewed changes
Comment thread Doc/howto/regex.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

@hugovk
Better wording
9f8fe36
JelleZijlstra
JelleZijlstra approved these changes Apr 14, 2026
View reviewed changes
@bedevere-app bedevere-app Bot added awaiting merge and removed awaiting core review labels Apr 14, 2026
@hugovk
hugovk merged commit bdb0b36 into python:main Apr 14, 2026
34 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@github-project-automation github-project-automation Bot moved this from Todo to Done in Docs PRs Apr 14, 2026
@hugovk
hugovk deleted the 3.15-howto-regex-re.match branch April 14, 2026 17:15
@bedevere-app bedevere-app Bot removed the awaiting merge label Apr 14, 2026
ljfp pushed a commit to ljfp/cpython that referenced this pull request Apr 25, 2026
@hugovk @hauntsaninja @ljfp
pythongh-86519: Update docs for prefixmatch (python#148096)
67fecb1
Co-authored-by: Shantanu <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@gpshead gpshead gpshead left review comments
@hauntsaninja hauntsaninja hauntsaninja left review comments
@JelleZijlstra JelleZijlstra JelleZijlstra approved these changes
@vsajip vsajip Awaiting requested review from vsajip vsajip is a code owner

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

docs Documentation in the Doc dir skip news

Projects

Docs PRs
Status: Done

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

4 participants

@hugovk @gpshead @JelleZijlstra @hauntsaninja
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.